Add System76 Power Module
- Remove sleep from waybar launch script - Re-order and re-arrange modules - Add left and right click events for modules - Change module colors - Remove commented lines - Add a slower scroll step to pavucontrol module
This commit is contained in:
71
README.org
71
README.org
@@ -52,6 +52,7 @@
|
|||||||
- [[#playerctl][Playerctl]]
|
- [[#playerctl][Playerctl]]
|
||||||
- [[#power-menu][Power Menu]]
|
- [[#power-menu][Power Menu]]
|
||||||
- [[#pulseaudio][Pulseaudio]]
|
- [[#pulseaudio][Pulseaudio]]
|
||||||
|
- [[#system76-power][System76 Power]]
|
||||||
- [[#tray][Tray]]
|
- [[#tray][Tray]]
|
||||||
- [[#end-configuration][End Configuration]]
|
- [[#end-configuration][End Configuration]]
|
||||||
- [[#justfile][Justfile]]
|
- [[#justfile][Justfile]]
|
||||||
@@ -499,8 +500,6 @@ static const Button buttons[] = {
|
|||||||
#+BEGIN_SRC shell :shebang #!/usr/bin/env bash :tangle waybar/launch.sh
|
#+BEGIN_SRC shell :shebang #!/usr/bin/env bash :tangle waybar/launch.sh
|
||||||
killall waybar
|
killall waybar
|
||||||
|
|
||||||
sleep 5
|
|
||||||
|
|
||||||
/usr/bin/waybar \
|
/usr/bin/waybar \
|
||||||
-c $HOME/.config/dwl/waybar/config.jsonc \
|
-c $HOME/.config/dwl/waybar/config.jsonc \
|
||||||
-s $HOME/.config/dwl/waybar/style.css &
|
-s $HOME/.config/dwl/waybar/style.css &
|
||||||
@@ -532,19 +531,20 @@ sleep 5
|
|||||||
"modules-left": [
|
"modules-left": [
|
||||||
"custom/power-menu",
|
"custom/power-menu",
|
||||||
"dwl/tags",
|
"dwl/tags",
|
||||||
],
|
|
||||||
"modules-center": [
|
|
||||||
"tray",
|
"tray",
|
||||||
],
|
],
|
||||||
"modules-right": [
|
"modules-center": [
|
||||||
"group/media-playing",
|
"group/dunst",
|
||||||
"pulseaudio",
|
"pulseaudio",
|
||||||
|
"group/media-playing",
|
||||||
|
],
|
||||||
|
"modules-right": [
|
||||||
|
"custom/system76-power",
|
||||||
"cpu",
|
"cpu",
|
||||||
"memory",
|
"memory",
|
||||||
"disk",
|
"disk",
|
||||||
"battery",
|
"battery",
|
||||||
"clock",
|
"clock",
|
||||||
"group/dunst",
|
|
||||||
],
|
],
|
||||||
"group/media-playing": {
|
"group/media-playing": {
|
||||||
"orientation": "horizontal",
|
"orientation": "horizontal",
|
||||||
@@ -554,7 +554,6 @@ sleep 5
|
|||||||
"custom/media-playing-play-pause",
|
"custom/media-playing-play-pause",
|
||||||
"custom/media-playing-next",
|
"custom/media-playing-next",
|
||||||
],
|
],
|
||||||
/* "drawer": {}, */
|
|
||||||
},
|
},
|
||||||
"group/dunst": {
|
"group/dunst": {
|
||||||
"orientation": "horizontal",
|
"orientation": "horizontal",
|
||||||
@@ -622,6 +621,7 @@ window#waybar {
|
|||||||
"interval": 5,
|
"interval": 5,
|
||||||
"format": " {usage}%",
|
"format": " {usage}%",
|
||||||
"tooltip": true,
|
"tooltip": true,
|
||||||
|
"on-click-right": "kitty btop",
|
||||||
},
|
},
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
@@ -629,7 +629,7 @@ window#waybar {
|
|||||||
|
|
||||||
#+BEGIN_SRC css :tangle waybar/style.css
|
#+BEGIN_SRC css :tangle waybar/style.css
|
||||||
#cpu {
|
#cpu {
|
||||||
background: #bd93f9;
|
background: #ff79c6;
|
||||||
color: #282a36;
|
color: #282a36;
|
||||||
}
|
}
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
@@ -765,6 +765,7 @@ fi
|
|||||||
"format": " {percentage_used}%",
|
"format": " {percentage_used}%",
|
||||||
"tooltip": true,
|
"tooltip": true,
|
||||||
"tooltip-format": "Used: {used} ({percentage_used}%)\nFree: {free} ({percentage_free}%)\nTotal: {total}",
|
"tooltip-format": "Used: {used} ({percentage_used}%)\nFree: {free} ({percentage_free}%)\nTotal: {total}",
|
||||||
|
"on-click-right": "qdirstat",
|
||||||
},
|
},
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
@@ -772,7 +773,7 @@ fi
|
|||||||
|
|
||||||
#+BEGIN_SRC css :tangle waybar/style.css
|
#+BEGIN_SRC css :tangle waybar/style.css
|
||||||
#disk {
|
#disk {
|
||||||
background: #ff79c6;
|
background: #f1fa8c;
|
||||||
color: #282a36;
|
color: #282a36;
|
||||||
}
|
}
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
@@ -787,6 +788,7 @@ fi
|
|||||||
"format": " {percentage}%",
|
"format": " {percentage}%",
|
||||||
"tooltip": true,
|
"tooltip": true,
|
||||||
"tooltip-format": "RAM:\n\tUsed: {used} GiB ({percentage}%)\n\tFree: {avail} GiB\n\tTotal: {total} GiB\nSwap:\n\tUsed: {swapUsed} GiB ({swapPercentage}%)\n\tFree: {swapAvail} GiB\n\tTotal: {swapTotal} GiB",
|
"tooltip-format": "RAM:\n\tUsed: {used} GiB ({percentage}%)\n\tFree: {avail} GiB\n\tTotal: {total} GiB\nSwap:\n\tUsed: {swapUsed} GiB ({swapPercentage}%)\n\tFree: {swapAvail} GiB\n\tTotal: {swapTotal} GiB",
|
||||||
|
"on-click-right": "kitty btop",
|
||||||
},
|
},
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
@@ -833,19 +835,19 @@ fi
|
|||||||
|
|
||||||
#+BEGIN_SRC css :tangle waybar/style.css
|
#+BEGIN_SRC css :tangle waybar/style.css
|
||||||
#custom-media-playing-change {
|
#custom-media-playing-change {
|
||||||
background: #50fa7b;
|
background: #f1fa8c;
|
||||||
color: #282a36;
|
color: #282a36;
|
||||||
}
|
}
|
||||||
#custom-media-playing-prev {
|
#custom-media-playing-prev {
|
||||||
background: #50fa7b;
|
background: #f1fa8c;
|
||||||
color: #282a36;
|
color: #282a36;
|
||||||
}
|
}
|
||||||
#custom-media-playing-play-pause {
|
#custom-media-playing-play-pause {
|
||||||
background: #50fa7b;
|
background: #f1fa8c;
|
||||||
color: #282a36;
|
color: #282a36;
|
||||||
}
|
}
|
||||||
#custom-media-playing-next {
|
#custom-media-playing-next {
|
||||||
background: #50fa7b;
|
background: #f1fa8c;
|
||||||
color: #282a36;
|
color: #282a36;
|
||||||
}
|
}
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
@@ -939,7 +941,6 @@ else
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# echo '{"text":"'$mediaSourceIcon'","tooltip":"\t'$title'\r\t'$artist'\r\t'$album'\r\t'$status'"}' | jq --unbuffered --compact-output
|
|
||||||
echo '{"text":"'$mediaSourceIcon'","tooltip":"\t'$title'\r\t'$artist'\r\t'$album'\r\t'$status'"}'
|
echo '{"text":"'$mediaSourceIcon'","tooltip":"\t'$title'\r\t'$artist'\r\t'$album'\r\t'$status'"}'
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
@@ -984,9 +985,11 @@ echo '{"text":"'$mediaSourceIcon'","tooltip":"\t'$title'\r\t'$artist'\r
|
|||||||
"default": "",
|
"default": "",
|
||||||
},
|
},
|
||||||
"scroll-step": 5,
|
"scroll-step": 5,
|
||||||
"on-click": "pavucontrol",
|
"on-click": "~/.scripts/pactl.sh --mute",
|
||||||
|
"on-click-right": "~/.scripts/pactl.sh --mixer",
|
||||||
"tooltip": true,
|
"tooltip": true,
|
||||||
"tooltip-format": "{desc}",
|
"tooltip-format": "{desc}",
|
||||||
|
"scroll-step": 0.25,
|
||||||
},
|
},
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
@@ -994,11 +997,45 @@ echo '{"text":"'$mediaSourceIcon'","tooltip":"\t'$title'\r\t'$artist'\r
|
|||||||
|
|
||||||
#+BEGIN_SRC css :tangle waybar/style.css
|
#+BEGIN_SRC css :tangle waybar/style.css
|
||||||
#pulseaudio {
|
#pulseaudio {
|
||||||
background: #ff5555;
|
background: #8be9fd;
|
||||||
color: #282a36;
|
color: #282a36;
|
||||||
}
|
}
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
*** System76 Power
|
||||||
|
|
||||||
|
**** Configuration
|
||||||
|
|
||||||
|
#+BEGIN_SRC jsonc :tangle waybar/config.jsonc
|
||||||
|
"custom/system76-power": {
|
||||||
|
"exec": "~/.config/dwl/waybar/scripts/system76-power.sh",
|
||||||
|
"return-type": "json",
|
||||||
|
"restart-interval": 60,
|
||||||
|
"on-click-right": "~/.scripts/cpu-gpu.sh --rofi",
|
||||||
|
"tooltip": true,
|
||||||
|
},
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
**** Styling
|
||||||
|
|
||||||
|
#+BEGIN_SRC css :tangle waybar/style.css
|
||||||
|
#custom-system76-power {
|
||||||
|
background: #ffb86c;
|
||||||
|
color: #282a36;
|
||||||
|
}
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
**** Script
|
||||||
|
|
||||||
|
#+BEGIN_SRC shell :shebang #!/usr/bin/env bash :tangle waybar/scripts/system76-power.sh
|
||||||
|
profile="$(sudo system76-power profile | sed -z '$ s/\n$//' | tr '\n' '\r')"
|
||||||
|
graphics="$(sudo system76-power graphics)"
|
||||||
|
graphicsPower="$(sudo system76-power graphics power)"
|
||||||
|
chargeThresholds="$(sudo system76-power charge-thresholds | sed -z '$ s/\n$//' | tr '\n' '\r')"
|
||||||
|
|
||||||
|
echo '{"text":" '$graphics'","tooltip":"\t'$graphics'\r\t'$graphicsPower'\r\r Profile\r'$profile'\r\r Charge Thresholds\r'$chargeThresholds'"}'
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
*** Tray
|
*** Tray
|
||||||
|
|
||||||
**** Configuration
|
**** Configuration
|
||||||
|
@@ -15,19 +15,20 @@
|
|||||||
"modules-left": [
|
"modules-left": [
|
||||||
"custom/power-menu",
|
"custom/power-menu",
|
||||||
"dwl/tags",
|
"dwl/tags",
|
||||||
],
|
|
||||||
"modules-center": [
|
|
||||||
"tray",
|
"tray",
|
||||||
],
|
],
|
||||||
"modules-right": [
|
"modules-center": [
|
||||||
"group/media-playing",
|
"group/dunst",
|
||||||
"pulseaudio",
|
"pulseaudio",
|
||||||
|
"group/media-playing",
|
||||||
|
],
|
||||||
|
"modules-right": [
|
||||||
|
"custom/system76-power",
|
||||||
"cpu",
|
"cpu",
|
||||||
"memory",
|
"memory",
|
||||||
"disk",
|
"disk",
|
||||||
"battery",
|
"battery",
|
||||||
"clock",
|
"clock",
|
||||||
"group/dunst",
|
|
||||||
],
|
],
|
||||||
"group/media-playing": {
|
"group/media-playing": {
|
||||||
"orientation": "horizontal",
|
"orientation": "horizontal",
|
||||||
@@ -37,7 +38,6 @@
|
|||||||
"custom/media-playing-play-pause",
|
"custom/media-playing-play-pause",
|
||||||
"custom/media-playing-next",
|
"custom/media-playing-next",
|
||||||
],
|
],
|
||||||
/* "drawer": {}, */
|
|
||||||
},
|
},
|
||||||
"group/dunst": {
|
"group/dunst": {
|
||||||
"orientation": "horizontal",
|
"orientation": "horizontal",
|
||||||
@@ -66,6 +66,7 @@
|
|||||||
"interval": 5,
|
"interval": 5,
|
||||||
"format": " {usage}%",
|
"format": " {usage}%",
|
||||||
"tooltip": true,
|
"tooltip": true,
|
||||||
|
"on-click-right": "kitty btop",
|
||||||
},
|
},
|
||||||
|
|
||||||
"clock": {
|
"clock": {
|
||||||
@@ -112,6 +113,7 @@
|
|||||||
"format": " {percentage_used}%",
|
"format": " {percentage_used}%",
|
||||||
"tooltip": true,
|
"tooltip": true,
|
||||||
"tooltip-format": "Used: {used} ({percentage_used}%)\nFree: {free} ({percentage_free}%)\nTotal: {total}",
|
"tooltip-format": "Used: {used} ({percentage_used}%)\nFree: {free} ({percentage_free}%)\nTotal: {total}",
|
||||||
|
"on-click-right": "qdirstat",
|
||||||
},
|
},
|
||||||
|
|
||||||
"memory": {
|
"memory": {
|
||||||
@@ -119,6 +121,7 @@
|
|||||||
"format": " {percentage}%",
|
"format": " {percentage}%",
|
||||||
"tooltip": true,
|
"tooltip": true,
|
||||||
"tooltip-format": "RAM:\n\tUsed: {used} GiB ({percentage}%)\n\tFree: {avail} GiB\n\tTotal: {total} GiB\nSwap:\n\tUsed: {swapUsed} GiB ({swapPercentage}%)\n\tFree: {swapAvail} GiB\n\tTotal: {swapTotal} GiB",
|
"tooltip-format": "RAM:\n\tUsed: {used} GiB ({percentage}%)\n\tFree: {avail} GiB\n\tTotal: {total} GiB\nSwap:\n\tUsed: {swapUsed} GiB ({swapPercentage}%)\n\tFree: {swapAvail} GiB\n\tTotal: {swapTotal} GiB",
|
||||||
|
"on-click-right": "kitty btop",
|
||||||
},
|
},
|
||||||
|
|
||||||
"custom/media-playing-change": {
|
"custom/media-playing-change": {
|
||||||
@@ -166,9 +169,19 @@
|
|||||||
"default": "",
|
"default": "",
|
||||||
},
|
},
|
||||||
"scroll-step": 5,
|
"scroll-step": 5,
|
||||||
"on-click": "pavucontrol",
|
"on-click": "~/.scripts/pactl.sh --mute",
|
||||||
|
"on-click-right": "~/.scripts/pactl.sh --mixer",
|
||||||
"tooltip": true,
|
"tooltip": true,
|
||||||
"tooltip-format": "{desc}",
|
"tooltip-format": "{desc}",
|
||||||
|
"scroll-step": 0.25,
|
||||||
|
},
|
||||||
|
|
||||||
|
"custom/system76-power": {
|
||||||
|
"exec": "~/.config/dwl/waybar/scripts/system76-power.sh",
|
||||||
|
"return-type": "json",
|
||||||
|
"restart-interval": 60,
|
||||||
|
"on-click-right": "~/.scripts/cpu-gpu.sh --rofi",
|
||||||
|
"tooltip": true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"tray": {
|
"tray": {
|
||||||
|
@@ -1,8 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
killall waybar
|
killall waybar
|
||||||
|
|
||||||
sleep 5
|
|
||||||
|
|
||||||
/usr/bin/waybar \
|
/usr/bin/waybar \
|
||||||
-c $HOME/.config/dwl/waybar/config.jsonc \
|
-c $HOME/.config/dwl/waybar/config.jsonc \
|
||||||
-s $HOME/.config/dwl/waybar/style.css &
|
-s $HOME/.config/dwl/waybar/style.css &
|
||||||
|
@@ -30,5 +30,4 @@ else
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# echo '{"text":"'$mediaSourceIcon'","tooltip":"\t'$title'\r\t'$artist'\r\t'$album'\r\t'$status'"}' | jq --unbuffered --compact-output
|
|
||||||
echo '{"text":"'$mediaSourceIcon'","tooltip":"\t'$title'\r\t'$artist'\r\t'$album'\r\t'$status'"}'
|
echo '{"text":"'$mediaSourceIcon'","tooltip":"\t'$title'\r\t'$artist'\r\t'$album'\r\t'$status'"}'
|
||||||
|
7
waybar/scripts/system76-power.sh
Executable file
7
waybar/scripts/system76-power.sh
Executable file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
profile="$(sudo system76-power profile | sed -z '$ s/\n$//' | tr '\n' '\r')"
|
||||||
|
graphics="$(sudo system76-power graphics)"
|
||||||
|
graphicsPower="$(sudo system76-power graphics power)"
|
||||||
|
chargeThresholds="$(sudo system76-power charge-thresholds | sed -z '$ s/\n$//' | tr '\n' '\r')"
|
||||||
|
|
||||||
|
echo '{"text":" '$graphics'","tooltip":"\t'$graphics'\r\t'$graphicsPower'\r\r Profile\r'$profile'\r\r Charge Thresholds\r'$chargeThresholds'"}'
|
@@ -16,7 +16,7 @@ window#waybar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#cpu {
|
#cpu {
|
||||||
background: #bd93f9;
|
background: #ff79c6;
|
||||||
color: #282a36;
|
color: #282a36;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,7 +60,7 @@ window#waybar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#disk {
|
#disk {
|
||||||
background: #ff79c6;
|
background: #f1fa8c;
|
||||||
color: #282a36;
|
color: #282a36;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,19 +70,19 @@ window#waybar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#custom-media-playing-change {
|
#custom-media-playing-change {
|
||||||
background: #50fa7b;
|
background: #f1fa8c;
|
||||||
color: #282a36;
|
color: #282a36;
|
||||||
}
|
}
|
||||||
#custom-media-playing-prev {
|
#custom-media-playing-prev {
|
||||||
background: #50fa7b;
|
background: #f1fa8c;
|
||||||
color: #282a36;
|
color: #282a36;
|
||||||
}
|
}
|
||||||
#custom-media-playing-play-pause {
|
#custom-media-playing-play-pause {
|
||||||
background: #50fa7b;
|
background: #f1fa8c;
|
||||||
color: #282a36;
|
color: #282a36;
|
||||||
}
|
}
|
||||||
#custom-media-playing-next {
|
#custom-media-playing-next {
|
||||||
background: #50fa7b;
|
background: #f1fa8c;
|
||||||
color: #282a36;
|
color: #282a36;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -92,7 +92,12 @@ window#waybar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#pulseaudio {
|
#pulseaudio {
|
||||||
background: #ff5555;
|
background: #8be9fd;
|
||||||
|
color: #282a36;
|
||||||
|
}
|
||||||
|
|
||||||
|
#custom-system76-power {
|
||||||
|
background: #ffb86c;
|
||||||
color: #282a36;
|
color: #282a36;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user