You are not logged in.

#1 2021-03-24 12:27:42

jwtiyar
Member
From: Kurdistan
Registered: 2013-01-25
Posts: 62

[SOLVED] Adding custom command to zsh or sxhkd

Hey
I have arch with bspwm and polybar
I want when I press super + f10 keys it increase screen brightness by 5

 brithnessctl s 5+

I did add it to.bashrc, .zshrc and sxhkdrc. But it didn't work I don't know how it should work.

Last edited by jwtiyar (2021-03-26 18:26:23)

Offline

#2 2021-03-24 13:08:57

schard
Forum Moderator
From: Hannover
Registered: 2016-05-06
Posts: 2,688
Website

Re: [SOLVED] Adding custom command to zsh or sxhkd

brithnessctl != brightnessctl
And if you just added this line, even if spelled correctly, it would just run the command each time .bashrc is sourced.

Last edited by schard (2021-03-24 13:11:22)


Inofficial first vice president of the Rust Evangelism Strike Force

Offline

#3 2021-03-26 15:46:11

jwtiyar
Member
From: Kurdistan
Registered: 2013-01-25
Posts: 62

Re: [SOLVED] Adding custom command to zsh or sxhkd

schard wrote:

brithnessctl != brightnessctl
And if you just added this line, even if spelled correctly, it would just run the command each time .bashrc is sourced.

sorry for late reply
I did correctly but didn't work, My question is how I can make a keybinding to make it every time I hit super + f10 it increases brightness by 5 ?

Offline

#4 2021-03-26 15:54:56

bolorino
Member
From: Spain
Registered: 2013-06-17
Posts: 18
Website

Re: [SOLVED] Adding custom command to zsh or sxhkd

If you are using bspwm, probably are using sxhkd too, so include this in your ~/.config/sxhkd/sxhkdrc

super + F10
    xdotool key XF86MonBrightnessUp

This will increase the brightness every time you press F10 if you have xdotool installed.

Change xdotool command for anything that fits your needs, like brightnessctl.


Improve my english... Work in progress

Offline

#5 2021-03-26 16:43:13

jwtiyar
Member
From: Kurdistan
Registered: 2013-01-25
Posts: 62

Re: [SOLVED] Adding custom command to zsh or sxhkd

bolorino wrote:

If you are using bspwm, probably are using sxhkd too, so include this in your ~/.config/sxhkd/sxhkdrc

super + F10
    xdotool key XF86MonBrightnessUp

This will increase the brightness every time you press F10 if you have xdotool installed.

Change xdotool command for anything that fits your needs, like brightnessctl.

Thank you for reply
None of them worked
I tried all

Offline

#6 2021-03-26 16:47:45

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,507
Website

Re: [SOLVED] Adding custom command to zsh or sxhkd

None of what worked.  Describe exactly what you have done and post the complete content of the relevant files.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#7 2021-03-26 17:09:18

Pellaeon
Member
Registered: 2020-06-15
Posts: 28

Re: [SOLVED] Adding custom command to zsh or sxhkd

I have a similar setup, and increase/decrease brightness by 10% with the following lines in sxhkdrc:

super + F10
    xbacklight -inc 10

super + F11
    xbacklight -dec 10

You could easily enough replace the 10 with a 5 or whatever other step size you want.

Also, if you change sxhkd config, you need to restart it for the changes to take affect.

Offline

#8 2021-03-26 17:11:57

jwtiyar
Member
From: Kurdistan
Registered: 2013-01-25
Posts: 62

Re: [SOLVED] Adding custom command to zsh or sxhkd

Trilby wrote:

None of what worked.  Describe exactly what you have done and post the complete content of the relevant files.

I tried all these options in sxhkdrc

#brightnessctl
super + <F9>
	brightnessctl s 5-
super + F10
    	brightnessctl key XF86MonBrightnessUp
super + <F10>
    	brightnessctl key XF86MonBrightnessUp

Offline

#9 2021-03-26 17:39:11

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,507
Website

Re: [SOLVED] Adding custom command to zsh or sxhkd

And all of those are gibberish.  Remove the ones with the <> symbols as sxhkd might fail to run with an improperly formatted config, and under "super + F10" which is the only correct one, put the command you actually want to run.  "brightnessctl key XF86MonBrightnessUp" is nonsensical.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#10 2021-03-26 18:25:48

jwtiyar
Member
From: Kurdistan
Registered: 2013-01-25
Posts: 62

Re: [SOLVED] Adding custom command to zsh or sxhkd

Trilby wrote:

And all of those are gibberish.  Remove the ones with the <> symbols as sxhkd might fail to run with an improperly formatted config, and under "super + F10" which is the only correct one, put the command you actually want to run.  "brightnessctl key XF86MonBrightnessUp" is nonsensical.

Thank you guys
This worked Thank you

super + F10 
        brightnessctl s 5+
super + F11
        brightnessctl s 5-

Offline

Board footer

Powered by FluxBB