Changed rofi launch mode
This commit is contained in:
Executable
+26
@@ -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"
|
||||||
@@ -63,7 +63,7 @@ static const Layout layouts[] = {
|
|||||||
|
|
||||||
/* commands */
|
/* commands */
|
||||||
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
|
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
|
||||||
static const char *dmenucmd[] = { "rofi", "-show", "drun", NULL};
|
static const char *dmenucmd[] = { "rofi", "-show", "run", NULL};
|
||||||
//sets st as the default terminal
|
//sets st as the default terminal
|
||||||
static const char *termcmd[] = { "st", NULL };
|
static const char *termcmd[] = { "st", NULL };
|
||||||
//volume controls
|
//volume controls
|
||||||
|
|||||||
Reference in New Issue
Block a user