Changed rofi launch mode

This commit is contained in:
hellisabove
2021-07-25 04:12:13 +03:00
parent 611cf852c9
commit 978b9dbeca
2 changed files with 27 additions and 1 deletions
Executable
+26
View File
@@ -0,0 +1,26 @@
#!/bin/bash
# base dir for backlight class
basedir="/sys/class/backlight/"
# get the backlight handler
handler=$basedir$(ls $basedir)"/"
# get current brightness
old_brightness=$(cat $handler"brightness")
# get max brightness
max_brightness=$(cat $handler"max_brightness")
# get current brightness %
old_brightness_p=$(( 100 * $old_brightness / $max_brightness ))
# calculate new brightness %
new_brightness_p=$(($old_brightness_p $1))
# calculate new brightness value
new_brightness=$(( $max_brightness * $new_brightness_p / 100 ))
# set the new brightness value
sudo chmod 666 $handler"brightness"
echo $new_brightness > $handler"brightness"