diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/Scripts/lc | 11 | ||||
-rwxr-xr-x | scripts/Scripts/screentool | 35 | ||||
-rwxr-xr-x | scripts/Scripts/volume | 5 |
3 files changed, 49 insertions, 2 deletions
diff --git a/scripts/Scripts/lc b/scripts/Scripts/lc index cdbe7a9..b423c24 100755 --- a/scripts/Scripts/lc +++ b/scripts/Scripts/lc @@ -3,7 +3,7 @@ LOGFILE=.lc.log DMENU="rofi -dmenu" -Commands="s suspend goto common pass set-keyboard poweroff lock scrot region overleaf-render caps-lock win wall cups pass sync" +Commands="s suspend screen goto common pass set-keyboard poweroff lock scrot region overleaf-render caps-lock win wall cups pass sync random" handle_stuff() { if [ "$1" = "--dmenu" ]; then @@ -52,6 +52,11 @@ handle_stuff() { $HOME/Scripts/setwall -A fi + if [ "$1" = "random" ]; then + stuff=$(python -c "print('\n'.join((str(i) for i in $(rofi -dmenu))))") + echo $stuff | tr " " "\n" | rofi -dmenu + fi + # Launch if [ "$1" = "s" ]; then $HOME/Scripts/guiworkspace.sh @@ -78,6 +83,10 @@ handle_stuff() { caja $(./Scripts/goto -d $(cat .bookmarks | awk -F ' ' '{print $1}' | $DMENU)) fi + if [ "$1" = "screen" ]; then + ~/Scripts/screentool + fi + # Calc if [ "$(echo $1 | head -c 1)" = "=" ]; then calc="$(echo $1 | cut -c 2-)" diff --git a/scripts/Scripts/screentool b/scripts/Scripts/screentool new file mode 100755 index 0000000..2d8da9e --- /dev/null +++ b/scripts/Scripts/screentool @@ -0,0 +1,35 @@ +#!/usr/bin/env bash +DMENU="rofi -dmenu -i" +XRANDR="xrandr" + +set -e + +displays=$(xrandr | awk -F ' ' '/ connected/ {print $1}') + +echo "Found displays ${displays}" + +# Prompt for display +chosen=$(echo ${displays} | tr " " "\n" | $DMENU -p "output") + +# get action +action=$(printf "auto\noff" | $DMENU -p "action") + +if [ "$action" = "off" ]; then + set -x + $XRANDR --output $chosen --off + exit 0 +fi + +# Get position +where=$(printf "left-of\nright-of\nbelow\nabove\nnone" | $DMENU -p "position") + +if [ "$where" = "none" ]; then + set -x + $XRANDR --output $chosen --auto + exit 0 +fi + +other=$(echo ${displays} | tr " " "\n" | $DMENU -p "other") + +set -x +$XRANDR --output $chosen --auto --${where} $other diff --git a/scripts/Scripts/volume b/scripts/Scripts/volume index 1a54728..105be1e 100755 --- a/scripts/Scripts/volume +++ b/scripts/Scripts/volume @@ -1,11 +1,14 @@ #!/usr/bin/env bash case $1 in + micmutetoggle) + pacmd set-source-mute @DEFAULT_SOURCE@ toggle + ;; softmute) pacmd set-source-volume @DEFAULT_SOURCE@ 0 ;; softunmute) - pacmd set-source-volume @DEFAULT_SOURCE@ 28000 + pacmd set-source-volume @DEFAULT_SOURCE@ 38000 ;; volumedown) pactl set-sink-volume @DEFAULT_SINK@ -5% |