Configurations de Sway et de la Waybar de Sway

This commit is contained in:
Hippolyte Chauvin 2023-04-13 00:06:35 +02:00
parent c1c1d8adbd
commit 046867e47b
8 changed files with 327 additions and 0 deletions

28
config/sway/config Normal file
View file

@ -0,0 +1,28 @@
set $mod Mod4
set $left h
set $down j
set $up k
set $right l
set $term kitty
set $menu rofi -show drun
set $browser librewolf
set $discord webcord
set $joplin joplin-desktop
input type:keyboard {
xkb_layout fr
xkb_numlock enabled
}
input type:touchpad {
natural_scroll enabled
accel_profile flat
tap enabled
pointer_accel 0.7
}
floating_modifier $mod normal
include /etc/sway/config.d/*
include config.d/*

View file

@ -0,0 +1,5 @@
exec --no-startup-id swaybg -c '#000000'
exec --no-startup-id swaync
exec --no-startup-id swayosd
exec --no-startup-id xdg-session-start

View file

@ -0,0 +1,93 @@
# Sway
bindsym $mod+Shift+q kill
bindsym $mod+Shift+r reload
bindsym $mod+Shift+e exec swaymsg exit
bindsym $mod+Mod1+l exec swaylock
# Launchers
bindsym $mod+Return exec $term
bindsym $mod+d exec $menu
bindsym $mod+F1 exec $browser
bindsym $mod+F2 exec $joplin
bindsym $mod+F3 exec $discord
# Windows
bindsym $mod+$left focus left
bindsym $mod+$down focus down
bindsym $mod+$up focus up
bindsym $mod+$right focus right
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
bindsym $mod+Shift+$left move left
bindsym $mod+Shift+$down move down
bindsym $mod+Shift+$up move up
bindsym $mod+Shift+$right move right
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# Workspaces
bindsym $mod+ampersand workspace number 1
bindsym $mod+eacute workspace number 2
bindsym $mod+quotedbl workspace number 3
bindsym $mod+apostrophe workspace number 4
bindsym $mod+parenleft workspace number 5
bindsym $mod+minus workspace number 6
bindsym $mod+egrave workspace number 7
bindsym $mod+underscore workspace number 8
bindsym $mod+ccedilla workspace number 9
bindsym $mod+agrave workspace number 10
bindsym $mod+Shift+ampersand move container to workspace number 1
bindsym $mod+Shift+eacute move container to workspace number 2
bindsym $mod+Shift+quotedbl move container to workspace number 3
bindsym $mod+Shift+apostrophe move container to workspace number 4
bindsym $mod+Shift+parenleft move container to workspace number 5
bindsym $mod+Shift+minus move container to workspace number 6
bindsym $mod+Shift+egrave move container to workspace number 7
bindsym $mod+Shift+underscore move container to workspace number 8
bindsym $mod+Shift+ccedilla move container to workspace number 9
bindsym $mod+Shift+agrave move container to workspace number 10
# Layouts
bindsym $mod+b splith
bindsym $mod+v splitv
bindsym $mod+s layout stacking
bindsym $mod+z layout tabbed
bindsym $mod+e layout toggle split
bindsym $mod+f fullscreen
bindsym $mod+Shift+space floating toggle
bindsym $mod+space focus mode_toggle
bindsym $mod+a focus parent
# Control
bindsym XF86AudioLowerVolume exec swayosd --output-volume=lower
bindsym XF86AudioRaiseVolume exec swayosd --output-volume=raise
bindsym XF86AudioMute exec swayosd --output-volume=mute-toggle
bindsym XF86MonBrightnessUp exec swayosd --brightness=raise
bindsym XF86MonBrightnessDown exec swayosd --brightness=lower
# Modes
# Resize
mode "resize" {
bindsym $left resize shrink width 40px
bindsym $down resize grow height 40px
bindsym $up resize shrink height 40px
bindsym $right resize grow width 40px
bindsym Left resize shrink width 40px
bindsym Down resize grow height 40px
bindsym Up resize shrink height 40px
bindsym Right resize grow width 40px
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
# Screenshots
bindsym Print exec glurp full clip
bindsym Shift+Print exec glurp area clip
bindsym Mod1+Print exec glurp full file
bindsym Mod1+Shift+Print exec glurp area file

View file

@ -0,0 +1,11 @@
# Colors
# <colorclass> <border> <background> <text> <indicator> <child_border>
client.focused #00ff00 #000000 #00ff00 #00ff00 #00ff00
client.focused_inactive #808080 #000000 #808080 #ffffff #808080
client.unfocused #808080 #000000 #808080 #ffffff #808080
client.urgent #ffff00 #000000 #ffff00 #ffffff #ffff00
# Borders
default_border pixel 1
default_floating_border normal 1

View file

@ -0,0 +1,4 @@
assign [app_id="^@joplin/app-desktop$"] 4
assign [class="^WebCord$"] 4
assign [class="^Deezer$"] 4

84
config/waybar-2/config Normal file
View file

@ -0,0 +1,84 @@
{
"layer": "top", // Waybar at top layer
"position": "bottom", // Waybar at the bottom of your screen
"height": 24, // Waybar height
// "width": 1366, // Waybar width
// Choose the order of the modules
"modules-left": ["sway/workspaces", "sway/mode", "sway/window"],
"modules-center": ["tray", "clock"],
"modules-right": ["pulseaudio", "network", "cpu", "memory", "battery"],
"sway/workspaces": {
"disable-scroll": true,
"all-outputs": false,
"format": "{icon} ",
"format-icons": {
"1:web": "",
"2:code": "",
"3:term": "",
"4:work": "",
"5:music": "",
"6:docs": "",
"urgent": "",
"focused": "",
"default": ""
}
},
"sway/mode": {
"format": "<span style=\"italic\">{}</span>"
},
"tray": {
// "icon-size": 21,
"spacing": 10
},
"clock": {
"format": "{:%Y-%m-%d | %H:%M:%S}"
},
"cpu": {
"format": "{usage}%  "
},
"memory": {
"format": "{}%  "
},
"battery": {
"bat": "BAT0",
"states": {
// "good": 95,
"warning": 30,
"critical": 15
},
"format": "{capacity}% {icon} ",
// "format-good": "", // An empty format will hide the module
// "format-full": "",
"format-icons": ["", "", "", "", ""]
},
"network": {
// "interface": "wlp2s0", // (Optional) To force the use of this interface
"format-wifi": "{essid} ({signalStrength}%)  ",
"format-ethernet": "{ifname}: {ipaddr}/{cidr} ",
"format-disconnected": "Disconnected ⚠ "
},
"pulseaudio": {
//"scroll-step": 1,
"format": "{volume}% {icon} ",
"format-bluetooth": "{volume}% {icon}  ",
"format-muted": "",
"format-icons": {
"headphones": "",
"handsfree": "",
"headset": "",
"phone": "",
"portable": "",
"car": "",
"default": ["", ""]
},
"on-click": "pavucontrol"
},
"custom/spotify": {
"format": " {}",
"max-length": 40,
"interval": 30, // Remove this if your script is endless and write in loop
"exec": "$HOME/.config/waybar/mediaplayer.sh 2> /dev/null", // Script in resources folder
"exec-if": "pgrep spotify"
}
}

7
config/waybar-2/mediaplayer.sh Executable file
View file

@ -0,0 +1,7 @@
#!/bin/sh
player_status=$(playerctl status 2> /dev/null)
if [ "$player_status" = "Playing" ]; then
echo "$(playerctl metadata artist) - $(playerctl metadata title)"
elif [ "$player_status" = "Paused" ]; then
echo "$(playerctl metadata artist) - $(playerctl metadata title)"
fi

95
config/waybar-2/style.css Normal file
View file

@ -0,0 +1,95 @@
* {
border: none;
border-radius: 0;
font-family: Hack Nerd Font;
font-size: 15px;
min-height: 0;
}
window#waybar {
background: transparent;
color: white;
}
#window {
font-weight: bold;
}
#workspaces button {
padding: 0 5px 0 10px;
background: transparent;
color: white;
border-top: 2px solid transparent;
}
#workspaces button.focused {
color: #00ff00;
border-top: 2px solid #00ff00;
}
#mode {
background: #64727D;
border-bottom: 3px solid white;
}
#clock, #battery, #cpu, #memory, #network, #pulseaudio, #custom-spotify, #tray, #mode {
padding: 0 3px;
margin: 0 2px;
}
#clock {
font-weight: bold;
}
#battery {
}
#battery icon {
color: red;
}
#battery.charging {
}
@keyframes blink {
to {
background-color: #ffffff;
color: black;
}
}
#battery.warning:not(.charging) {
color: white;
animation-name: blink;
animation-duration: 0.5s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
}
#cpu {
}
#memory {
}
#network {
}
#network.disconnected {
background: #f53c3c;
}
#pulseaudio {
}
#pulseaudio.muted {
}
#custom-spotify {
color: rgb(102, 220, 105);
}
#tray {
}