Greg,

I didn't know about xbindkeys. I'm new with suckless tools, I'm working on
my dwm setup (st and dmenu too) and I didn't know the best way to do it.
Considering the suckless philosophy, is the way you tell me better than a
dwm patch? Or would you say it's just a different way of making it work?
Because I still haven't solved it for the volume control keys.

Thanks for comment!

Gonzalo


On Mon, Apr 13, 2020 at 4:41 PM Greg Minshall <[email protected]> wrote:

> Gonzalo,
>
> i do this outside of dwm, using, rather, xbindkeys(1).  my .xbindkeysrc
> has this
> ----
> # Increase backlight
> "myxbacklight -inc 10"
>    XF86MonBrightnessUp
> # Decrease backlight
> "myxbacklight -dec 10"
>    XF86MonBrightnessDown
> ----
>
> and, myxbacklight (which i'm not offering as a model of great
> programming!) looks as follows:
> ----
> #!/bin/sh
>
> # does xbacklight, then brags about it
>
> x=$(xbacklight -get | sed s/[.].*//)
> if [[ "$1" == "-dec" ]]; then
>     if [[ $(($x-$2)) -lt 10 ]]; then
>         set -- -set $(($x-1))
>     fi
> elif [[ "$1" == "-inc" ]]; then
>     if [[ $x -lt 10 ]]; then
>         set -- -set $(($x+1))
>     fi
> fi
>
> xbacklight $*
>
>
> myid=$(dc -e "16 i $(echo $0 | sha1sum 2>&1 | sed 's/\(^.....\).*$/\1/' |
> tr '[:lower:]' '[:upper:]') p")
>
> dunstify --replace=${myid} "Brightness: $(dc -e 3k$(xbacklight)\ .5+0k1/p)
> percent"
> ----
>
> cheers, Greg
>


-- 
Gonzalo Gabriel Fernández

Reply via email to