ErikReider / SwayNotificationCenter

A simple GTK based notification daemon for SwayWM
GNU General Public License v3.0
1.41k stars 63 forks source link

feat: add slider widget #435

Open rtgiskard opened 5 months ago

rtgiskard commented 5 months ago

For me, this makes it possible to control backlight with ddcutil:

"slider#backlight": {
    "label": "󰃟",
    "max_limit": 86,
    "min_limit": 1,
    "min": 0,
    "max": 100,
    "cmd_setter": "~/.config/hypr/script/utils.sh swaync_backlight set $value",
    "cmd_getter": "~/.config/hypr/script/utils.sh swaync_backlight get"
},
swaync_backlight() { # args: set|get [value]
    case "$1" in
    set) ddcutil setvcp 0x10 $2 ;;
    get) ddcutil getvcp 0x10 | grep -oP "current value =\s+\K[0-9]+" ;;
    esac
}