power menu, redshift, polybar

This commit is contained in:
azpsen
2024-01-28 16:37:10 -06:00
parent 89516a6ce1
commit 319b44ecbd
307 changed files with 7642 additions and 5 deletions

View File

@@ -0,0 +1,27 @@
# Script: pipewire-simple
A script to control pipewire with your mouse buttons and scroll wheel.
![pipewire-simple](screenshots/1.png)
## Dependencies
* `pactl`
* `pamixer`
Maybe `pavucontrol` is a good idea. In the example it is opened with a right mouse click.
## Module
```ini
[module/pipewire-simple]
type = custom/script
exec = ~/polybar-scripts/pipewire-simple.sh
interval = 3
click-right = exec pavucontrol &
click-left = ~/polybar-scripts/pipewire-simple.sh --mute &
scroll-up = ~/polybar-scripts/pipewire-simple.sh --up &
scroll-down = ~/polybar-scripts/pipewire-simple.sh --down &
```

View File

@@ -0,0 +1,31 @@
#!/bin/sh
getDefaultSink() {
defaultSink=$(pactl info | awk -F : '/Default Sink:/{print $2}')
description=$(pactl list sinks | sed -n "/${defaultSink}/,/Description/s/^\s*Description: \(.*\)/\1/p")
echo "${description}"
}
getDefaultSource() {
defaultSource=$(pactl info | awk -F : '/Default Source:/{print $2}')
description=$(pactl list sources | sed -n "/${defaultSource}/,/Description/s/^\s*Description: \(.*\)/\1/p")
echo "${description}"
}
VOLUME=$(pamixer --get-volume-human)
SINK=$(getDefaultSink)
SOURCE=$(getDefaultSource)
case $1 in
"--up")
pamixer --increase 10
;;
"--down")
pamixer --decrease 10
;;
"--mute")
pamixer --toggle-mute
;;
*)
echo "Source: ${SOURCE} | Sink: ${VOLUME} ${SINK}"
esac

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB