First commit. Add .i3 directory
This commit is contained in:
32
.i3/scripts/adjbr.sh
Normal file
32
.i3/scripts/adjbr.sh
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Launches a yad window to change the brightness (or volume, not in use)
|
||||
panel_fifo="/tmp/i3_lemonbar1_${USER}"
|
||||
panel_commands="/tmp/i3_lemonbar2_${USER}"
|
||||
|
||||
if [ "$1" == "-b" ]; then
|
||||
CLASS="YADWINBR"
|
||||
ICON='☼'
|
||||
COLOR='yellow'
|
||||
elif [ "$1" == "-v" ]; then
|
||||
CLASS="YADWINV"
|
||||
ICON='🔈'
|
||||
COLOR='white'
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
LEVEL=$(bc <<< "scale=0; $(brillo -G)/1")
|
||||
[[ "$3" == "-t" ]] && TIMER="--timeout=1"
|
||||
|
||||
declare -a YADARGS=("--sticky" "--undecorated" "--on-top" "--class=$CLASS"
|
||||
"--scale" "--text='<span color=\"$COLOR\" font=\"20\">$ICON</span>'"
|
||||
"--value" "$LEVEL" "--no-buttons"
|
||||
"--geometry=15x150" "--vertical" "--text-align" "center" "$TIMER" "--print-partial")
|
||||
YARGS=${YADARGS[@]}
|
||||
|
||||
FIFO="$2"
|
||||
|
||||
(echo "kill_unfocus $BASHPID" > $FIFO; exec sh -c "yad $YARGS") | \
|
||||
while read out; do
|
||||
~/.i3/scripts/level.sh -b set $out
|
||||
done
|
||||
Reference in New Issue
Block a user