mirror of
https://github.com/kastdeur/dotfiles.git
synced 2025-05-15 12:29:23 +02:00
[polybar] Added some PolyBar Config
This commit is contained in:
parent
375c954e2b
commit
b62b55e417
11 changed files with 908 additions and 1 deletions
4
polybar/scripts/info-autofs.sh
Normal file
4
polybar/scripts/info-autofs.sh
Normal file
|
@ -0,0 +1,4 @@
|
|||
#!/bin/bash
|
||||
|
||||
AUTOFS_CONNECTED="歷"
|
||||
AUTOFS_DISCONNECTED="轢"
|
15
polybar/scripts/info-redshift-temp.sh
Executable file
15
polybar/scripts/info-redshift-temp.sh
Executable file
|
@ -0,0 +1,15 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ "$(pgrep -x redshift)" ]; then
|
||||
temp=$(redshift -p 2> /dev/null | grep temp | cut -d ":" -f 2 | tr -dc "[:digit:]")
|
||||
|
||||
if [ -z "$temp" ]; then
|
||||
echo "%{F#666} ﯧ"
|
||||
elif [ "$temp" -ge 5000 ]; then
|
||||
echo "%{F#ffeeee} ﯦ"
|
||||
elif [ "$temp" -ge 4000 ]; then
|
||||
echo "%{F#ffaaaa} ﯦ"
|
||||
else
|
||||
echo "%{F#ff0000} ﯦ"
|
||||
fi
|
||||
fi
|
20
polybar/scripts/powermenu
Normal file
20
polybar/scripts/powermenu
Normal file
|
@ -0,0 +1,20 @@
|
|||
#!/bin/bash
|
||||
|
||||
uptime=$(uptime -p | sed -e 's/up //g')
|
||||
|
||||
# Options
|
||||
shutdown = " Shutdown"
|
||||
reboot = " Reboot"
|
||||
lock = " Lock"
|
||||
|
||||
|
||||
case $chosen in
|
||||
$shutdown)
|
||||
systemctl poweroff
|
||||
;;
|
||||
$reboot)
|
||||
systemctl reboot
|
||||
;;
|
||||
$lock
|
||||
;;
|
||||
esac
|
59
polybar/scripts/pulseaudio-default-microphone.sh
Executable file
59
polybar/scripts/pulseaudio-default-microphone.sh
Executable file
|
@ -0,0 +1,59 @@
|
|||
#!/bin/sh
|
||||
|
||||
PACMD="pacmd"
|
||||
|
||||
status() {
|
||||
MUTED=$($PACMD list-sources | awk '/\*/,EOF {print}' | awk '/muted/ {print $2; exit}')
|
||||
|
||||
if [ "$MUTED" = "yes" ]; then
|
||||
echo "%{F#F00}"
|
||||
else
|
||||
echo ""
|
||||
fi
|
||||
}
|
||||
|
||||
listen() {
|
||||
status
|
||||
|
||||
LANG=EN; pactl subscribe | while read -r event; do
|
||||
if echo "$event" | grep -q "source" || echo "$event" | grep -q "server"; then
|
||||
status
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
toggle() {
|
||||
MUTED=$($PACMD list-sources | awk '/\*/,EOF {print}' | awk '/muted/ {print $2; exit}')
|
||||
DEFAULT_SOURCE=$($PACMD list-sources | awk '/\*/,EOF {print $3; exit}')
|
||||
|
||||
if [ "$MUTED" = "yes" ]; then
|
||||
$PACMD set-source-mute "$DEFAULT_SOURCE" 0
|
||||
else
|
||||
$PACMD set-source-mute "$DEFAULT_SOURCE" 1
|
||||
fi
|
||||
}
|
||||
|
||||
increase() {
|
||||
DEFAULT_SOURCE=$($PACMD list-sources | awk '/\*/,EOF {print $3; exit}')
|
||||
$PACMD set-source-volume "$DEFAULT_SOURCE" +5%
|
||||
}
|
||||
|
||||
decrease() {
|
||||
DEFAULT_SOURCE=$($PACMD list-sources | awk '/\*/,EOF {print $3; exit}')
|
||||
$PACMD set-source-volume "$DEFAULT_SOURCE" -5%
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
--toggle)
|
||||
toggle
|
||||
;;
|
||||
--increase)
|
||||
increase
|
||||
;;
|
||||
--decrease)
|
||||
decrease
|
||||
;;
|
||||
*)
|
||||
listen
|
||||
;;
|
||||
esac
|
Loading…
Add table
Add a link
Reference in a new issue