power menu, redshift, polybar
This commit is contained in:
27
.config/polybar/scripts/pipewire-simple/README.md
Normal file
27
.config/polybar/scripts/pipewire-simple/README.md
Normal file
@@ -0,0 +1,27 @@
|
||||
# Script: pipewire-simple
|
||||
|
||||
A script to control pipewire with your mouse buttons and scroll wheel.
|
||||
|
||||

|
||||
|
||||
|
||||
## 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 &
|
||||
```
|
||||
31
.config/polybar/scripts/pipewire-simple/pipewire-simple.sh
Normal file
31
.config/polybar/scripts/pipewire-simple/pipewire-simple.sh
Normal 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
|
||||
BIN
.config/polybar/scripts/pipewire-simple/screenshots/1.png
Normal file
BIN
.config/polybar/scripts/pipewire-simple/screenshots/1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.8 KiB |
Reference in New Issue
Block a user