Add Waybar

This commit is contained in:
Thomas Avé 2023-12-01 21:11:36 +01:00
parent 2ebe3460ea
commit a791e9c4d8
3 changed files with 250 additions and 7 deletions

View File

@ -21,9 +21,7 @@ decoration {
rounding = 1
blur {
enabled = true
size = 3
passes = 1
enabled = false
}
drop_shadow = yes
@ -48,9 +46,7 @@ animations {
}
dwindle {
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
preserve_split = yes # you probably want this
preserve_split = yes
no_gaps_when_only=1
}
@ -82,21 +78,46 @@ $mainMod = SUPER
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
bindr = $mainMod, SUPER_L, exec, /home/user/.config/awesome/scripts/toggle_rofi.sh
bind = $mainMod, return, exec, alacritty
bind = $mainMod, return, exec, /home/user/.config/awesome/scripts/launch_alacritty.sh $(hyprctl activewindow -j | jq .pid)
bind = $mainMod SHIFT, return, exec, alacritty
bind = $mainMod, Q, killactive,
bind = $mainMod, A, exec, nautilus
bind = $mainMod, B, exec, firefox
bind = $mainMod, M, fullscreen, 1
bind = $mainMod, F11, fullscreen
bind = $mainMod, F, togglefloating,
bind = $mainMod, SPACE, togglesplit, # dwindle
bind = CONTROL_L ALT_L, L, exec, swaylock
bind = $mainMod, C, exec, CM_LAUNCHER=rofi-script rofi -modi "clipmenu:/usr/bin/clipmenu" -show clipmenu
bind = $mainMod, Y, exec, /home/user/.config/rofi/rofi-ykman.sh
bind = Control Mod2 Mod4, Q, exec, systemctl suspend
bind = $mainMod, Escape, exec, rofi -show power-menu -modi power-menu:/home/user/.config/awesome/scripts/rofi-power-menu
bind = ,XF86PowerOff, exec, rofi -show power-menu -modi power-menu:/home/user/.config/awesome/scripts/rofi-power-menu
bind = ,XF86MonBrightnessUp, exec, xbacklight -inc 10
bind = ,XF86MonBrightnessDown, exec, xbacklight -dec 10
bind = ,XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 10%+ --limit 1.0
bind = ,XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 10%-
bind = ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
bind = ,XF86AudioNext, exec, playerctl next
bind = ,XF86AudioPrev, exec, playerctl previous
bind = $mainMod,XF86AudioMute, exec, playerctl play-pause
bind = $mainMod,XF86AudioRaiseVolume, exec, playerctl next
bind = $mainMod,XF86AudioLowerVolume, exec, playerctl previous
# Move focus with mainMod + arrow keys
bind = $mainMod, H, movefocus, l
bind = $mainMod, L, movefocus, r
bind = $mainMod, K, movefocus, u
bind = $mainMod, J, movefocus, d
bind = $mainMod SHIFT, H, movewindow, l
bind = $mainMod SHIFT, L, movewindow, r
bind = $mainMod SHIFT, K, movewindow, u
bind = $mainMod SHIFT, J, movewindow, d
bind = $mainMod CONTROL_L, L, resizeactive, 20 0
bind = $mainMod CONTROL_L, H, resizeactive, -20 0
bind = $mainMod CONTROL_L, K, resizeactive, 0 -20
bind = $mainMod CONTROL_L, J, resizeactive, 0 20
# Switch workspaces with mainMod + [0-9]
bind = $mainMod, 1, workspace, 1

85
waybar/config Normal file
View File

@ -0,0 +1,85 @@
{
"layer": "top", // Waybar at top layer
"height": 28, // Waybar height (to be removed for auto height)
"spacing": 4, // Gaps between modules (4px)
"modules-left": ["hyprland/window"],
"modules-center": ["hyprland/workspaces"],
"modules-right": ["tray", "wireplumber", "cpu", "memory", "temperature", "battery", "clock"],
"wireplumber": {
"format": "{icon} {volume}%",
"on-click": "helvum",
"format-muted": "",
"on-click": "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle",
"format-icons": ["", "", ""]
},
"hyprland/workspaces": {
"disable-scroll": true,
"all-outputs": false,
"warp-on-scroll": false
},
"tray": {
// "icon-size": 21,
"spacing": 10
},
"clock": {
"timezone": "Europe/Brussels",
"format": "{:%H:%M:%S}",
"interval": 1,
"format-alt": "{:%Y-%m-%d}"
},
"cpu": {
"format": "{max_frequency}GHz",
"tooltip": false,
"interval": 5
},
"memory": {
"interval": 5,
"format": "{used:0.2f}G"
},
"temperature": {
"thermal-zone": 6,
// "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input",
"critical-threshold": 80,
// "format-critical": "{temperatureC}°C {icon}",
"format": "{temperatureC}°C",
// "format-icons": ["", "", ""]
},
"battery": {
"states": {
// "good": 95,
"warning": 30,
"critical": 15
},
"format": "{icon}",
"format-plugged": "{capacity}% ",
"format-alt": "{capacity}% {time} {icon}",
// "format-good": "", // An empty format will hide the module
// "format-full": "",
"format-icons": [" ", " ", " ", " ", " "]
},
"battery#bat2": {
"bat": "BAT2"
},
"network": {
// "interface": "wlp2*", // (Optional) To force the use of this interface
"format-wifi": "{essid} ({signalStrength}%) ",
"format-ethernet": "{ipaddr}/{cidr} ",
"tooltip-format": "{ifname} via {gwaddr} ",
"format-linked": "{ifname} (No IP) ",
"format-disconnected": "Disconnected ⚠",
"format-alt": "{ifname}: {ipaddr}/{cidr}"
},
"custom/media": {
"format": "{icon} {}",
"return-type": "json",
"max-length": 40,
"format-icons": {
"spotify": "",
"default": "🎜"
},
"escape": true,
"exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder
// "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name
}
}

137
waybar/style.css Normal file
View File

@ -0,0 +1,137 @@
* {
/* `otf-font-awesome` is required to be installed for icons */
font-family: Ubuntu;
font-size: 14px;
font-weight:500;
}
window#waybar {
background-color: rgba(0, 0, 0, 0.3);
color: #ffffff;
transition-property: background-color;
transition-duration: .5s;
}
/* window#waybar.hidden { */
/* opacity: 0.2; */
/* } */
button {
border: none;
border-radius: 0;
}
button:hover {
background: inherit;
box-shadow: inset 0 0 #ffffff;
}
#workspaces button {
padding: 0 8px;
background-color: transparent;
color: #ffffff;
}
#workspaces button:hover {
background-color: #002F5F;
}
#workspaces button.focused {
background-color: #002F5F;
}
#workspaces button.active {
background-color: #002F5F;
}
#workspaces button.urgent {
background-color: #ed8274;
}
#window,
#clock,
#battery,
#cpu,
#memory,
#disk,
#temperature,
#backlight,
#network,
#pulseaudio,
#wireplumber,
#tray {
padding: 0 10px;
border-radius: 3px;
color: #ffffff;
background-color: #002F5F;
margin-left:1.5px;
margin-right:1.5px;
}
#window {
font-weight:400;
font-size:14px;
margin-left:0;
}
#clock {
margin-right:0;
}
#workspaces {
margin: 0 10px;
}
/* If workspaces is the leftmost module, omit left margin */
.modules-left > widget:first-child > #workspaces {
margin-left: 0;
}
/* If workspaces is the rightmost module, omit right margin */
.modules-right > widget:last-child > #workspaces {
margin-right: 0;
}
@keyframes blink {
to {
background-color: #ffffff;
color: #000000;
}
}
#battery.critical:not(.charging) {
background-color: #f53c3c;
color: #ffffff;
animation-name: blink;
animation-duration: 0.5s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
}
label:focus {
background-color: #000000;
}
#custom-media {
background-color: #66cc99;
color: #2a5c45;
min-width: 100px;
}
#custom-media.custom-spotify {
background-color: #66cc99;
}
#custom-media.custom-vlc {
background-color: #ffa000;
}
#tray > .passive {
-gtk-icon-effect: dim;
}
#tray > .needs-attention {
-gtk-icon-effect: highlight;
background-color: #eb4d4b;
}