You are not logged in.
Hi. As the title says, I'm trying to blacklist one certain command from being executed in the terminal. For various reason, I'm using xrandr to manage my screen brightness, but I want to avoid accidentally setting the brightness to 0. So what I'm essentially trying to do is render the command "xrandr --output LVDS-1 --brightness 0" ineffective. What should I do?
Last edited by alpindale (2021-08-06 19:44:26)
Offline
Ah ... not type that command. If you don't want to run that command, why would you type it then hit enter? Nothing else is running that command behind the scenes. Any other approach would be ... well, not very bright.
You could make a xrandr wrapper script that effectively blocked that command and passed on all others, but if you are fighting against your own anti-brightness-addiction, you'd be able to circumvent your own intervention by calling /bin/xrandr directly.
I suspect, though, that this is an X-Y question. Do you really have some script to adjust brightness and you want to prevent it from getting all the way to zero? If so, there are much better ways of acheiving that - if this is the case, please post your current script.
Last edited by Trilby (2021-08-06 20:30:00)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Ah ... not type that command. If you don't want to run that command, why would you type it then hit enter? Nothing else is running that command behind the scenes. Any other approach would be ... well, not very bright.
You could make a xrandr wrapper script that effectively blocked that command and passed on all others, but if you are fighting against your own anti-brightness-addiction, you'd be able to circumvent your own intervention by calling /bin/xrandr directly.
I suspect, though, that this is an X-Y question. Do you really have some script to adjust brightness and you want to prevent it from getting all the way to zero? If so, there are much better ways of acheiving that - if this is the case, please post your current script.
Ah well, since the maximum value is 1, my input values are between 0.1 and 1, and I did accidentally hit enter when it was still "0." one time, which resulted in my screen going completely black. What I'm doing is preventing that from happening ever again, since it's gonna be a bother to fix it.
Offline
since it's gonna be a bother to fix it.
No bother at all. Just press the up arrow to recall the previous command then hit 1[ENTER]
Offline
alias "xrandr --output LVDS-1 --brightness 0" to "xrandr --output LVDS-1 --brightness 1"?
Last edited by Skunky (2021-08-06 21:10:17)
Offline
alias "xrandr --output LVDS-1 --brightness 0" to "xrandr --output LVDS-1 --brightness 1"?
Whoa that's actually quite brilliant. Thanks.
Offline
How often are you even entering that command? Why not make a script / keybinding / etc?
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
since the maximum value is 1, my input values are between 0.1 and 1, and I did accidentally hit enter when it was still "0."
That's incorrect, randr brightness manipulates the gamma ramps (it doesn't alter the backlight and you'll not save energy this way) and therefore easily allows values > 1 (turning the output brighter)
alias "xrandr --output LVDS-1 --brightness 0" to "xrandr --output LVDS-1 --brightness 1"
my input values are between 0.1 and 1
…
Did you try the alias ![]()
Follow Trilby's advice and make a shell function or script.
Make it simpler, so you don't have to type so much (eg. shorter command find all connected displays and alter them equally, make the value range 0-100 and guard against toolow™ values)
Also you can switch to a different VT (eg. crtl+alt+f3) and fix the value from there (again: no impact on the actual backlight)
Offline