feat: waybar tray style

This commit is contained in:
hesam-init 2024-02-26 16:50:27 +03:30
parent 9197ce34fa
commit d52b472627
5 changed files with 90 additions and 81 deletions

View file

@ -1,6 +1,7 @@
#!/usr/bin/env bash
# waybar env :
export WAYBAR_DEV_MODE=false
export WAYBAR_THEME="river"
export WAYBAR_DIR="$HOME/.config/waybar/$WAYBAR_THEME"
export WAYBAR_LAUNCHER="waybar -c $WAYBAR_DIR/config.jsonc -s $WAYBAR_DIR/style.css"

View file

@ -32,6 +32,9 @@ calculate_progress() {
}
case $1 in
t)
pactl set-source-mute @DEFAULT_SOURCE@ toggle
;;
u)
current_volume=$(get_current_volume)
new_volume=$((current_volume + 5))

View file

@ -6,6 +6,10 @@ WAYBAR_PID=$(pgrep -x waybar)
if [ -n "$WAYBAR_PID" ]; then
pkill waybar
fi
if [ $WAYBAR_DEV_MODE = true ]; then
GTK_DEBUG=interactive exec $WAYBAR_LAUNCHER
else
exec $WAYBAR_LAUNCHER
fi

View file

@ -7,29 +7,66 @@
"margin-bottom": 4,
"margin-left": 6,
"margin-right": 6,
"modules-right": [
"modules-center": [
"clock",
"hyprland/language",
"cpu",
"custom/gpu-usage",
"wireplumber",
"hyprland/language",
"clock"
"pulseaudio#input",
"pulseaudio#output"
],
"modules-left": [
// "custom/launcher",
"hyprland/workspaces",
"tray"
],
"modules-center": [
// "pulseaudio"
// "custom/snip"
// "custom/updater",
// "custom/wallpaper",
// "pulseaudio/slider",
"modules-right": [
// "custom/launcher",
"battery",
"memory",
"network",
"network#network-2"
],
"wireplumber": {
"scroll-step": 5,
"format": "{volume}% {icon}",
"format-bluetooth": "{volume}% {icon}",
"format-bluetooth-muted": "{icon} {format_source}",
"format-muted": "",
"format-source": "",
"format-source-muted": "",
"format-icons": {
"default": [
"",
"",
""
]
},
"on-click": "helvum",
"max-volume": 150,
"tooltip": false
},
"pulseaudio#output": {
"format": "{icon} {volume}%",
"format-muted": " 0%",
"format-source": "",
"format-icons": {
"default": [
"",
"",
""
]
},
"max-volume": 150,
"scroll-step": 5,
"on-click": "pavucontrol"
},
"pulseaudio#input": {
"format-source": " {volume}%",
"format-source-muted": " 0%",
"format": "{format_source}",
"on-click": "pactl set-source-mute @DEFAULT_SOURCE@ toggle",
"on-scroll-up": "pactl set-source-volume @DEFAULT_SOURCE@ +5%",
"on-scroll-down": "pactl set-source-volume @DEFAULT_SOURCE@ -5%"
},
"hyprland/language": {
"format": "{}",
"format-en": "English"
@ -46,7 +83,7 @@
},
"clock": {
"interval": 1,
"format": "{:%H:%M:%S}",
"format": "{:%H:%M} ",
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
},
"pulseaudio": {
@ -72,31 +109,6 @@
},
"on-click": "pavucontrol"
},
"wireplumber": {
"scroll-step": 5,
"format": "{volume}% {icon}",
"format-bluetooth": "{volume}% {icon}",
"format-bluetooth-muted": "{icon} {format_source}",
"format-muted": "",
"format-source": "",
"format-source-muted": "",
"format-icons": {
"headphone": "",
"hands-free": "",
"headset": "",
"phone": "",
"portable": "",
"car": "",
"default": [
"",
"",
""
]
},
"on-click": "helvum",
"max-volume": 150,
"tooltip": false
},
"pulseaudio/slider": {
"min": 0,
"max": 100,

View file

@ -32,8 +32,6 @@ window#waybar.hidden {
#custom-launcher,
#custom-power,
#taskbar,
#mode,
#idle_inhibitor,
#wireplumber,
#language,
#workspaces,
@ -45,7 +43,30 @@ window#waybar.hidden {
#workspaces,
#tray {
padding: 0px 12px;
padding: 0px 10px;
}
#tray menu * {
all: unset;
}
#tray menu {
background-color: @backgrounddark;
}
#tray menu menuitem {
border-radius: 4px;
padding: 6px;
}
#tray menu separator {
min-height: 1px;
margin: 6px 0px;
background: @workspacesbackground2;
}
#tray menu menuitem:hover {
background-color: #f53c3c;
}
#workspaces * {
@ -103,8 +124,13 @@ window#waybar.hidden {
background-color: #90b1b1;
}
#custom-playerlabel {
min-width: 170px;
#custom-power {
font-size: 18px;
min-width: 20px;
}
#custom-launcher {
font-size: 18px;
}
#network {
@ -120,47 +146,10 @@ window#waybar.hidden {
color: red;
}
#custom-media {
color: white;
}
#custom-media.custom-spotify {
color: white;
}
#custom-media.custom-vlc {
color: white;
}
#custom-power {
font-size: 18px;
min-width: 20px;
}
#custom-launcher {
font-size: 18px;
}
#custom-wallpaper {
color: pink;
font-size: 20px;
}
#temperature.critical {
background-color: #eb4d4b;
}
#pulseaudio {
min-width: 55px;
}
#pulseaudio.muted {
color: red;
}
#language,
#clock,
#wireplumber,
#pulseaudio,
#cpu,
#custom-gpu-usage {
min-width: 65px;