From e5db995945c867e7933c331524641c6a873a6cd7 Mon Sep 17 00:00:00 2001 From: Julian T Date: Thu, 25 Feb 2021 13:56:54 +0100 Subject: Changes to i3 and scripts around it --- i3/.config/i3/config | 4 +++- scripts/Scripts/lc | 11 ++++++++++- scripts/Scripts/screentool | 35 +++++++++++++++++++++++++++++++++++ scripts/Scripts/volume | 5 ++++- termite/.config/termite/config | 2 +- 5 files changed, 53 insertions(+), 4 deletions(-) create mode 100755 scripts/Scripts/screentool diff --git a/i3/.config/i3/config b/i3/.config/i3/config index 6602f4d..dbce801 100644 --- a/i3/.config/i3/config +++ b/i3/.config/i3/config @@ -167,14 +167,16 @@ bindsym XF86MonBrightnessDown exec --no-startup-id xbacklight -dec 5 # volume settings bindsym XF86AudioRaiseVolume exec ~/Scripts/volume volumeup bindsym XF86AudioLowerVolume exec ~/Scripts/volume volumedown +bindsym XF86AudioMicMute exec ~/Scripts/volume micmutetoggle bindsym XF86AudioMute exec ~/Scripts/volume volumetoggle bindsym XF86AudioPlay exec ~/Scripts/volume playtoggle bindsym XF86AudioPrev exec ~/Scripts/volume backward bindsym XF86AudioNext exec ~/Scripts/volume forward +bindsym XF86Display exec ~/Scripts/screentool # launch script thingy bindsym $mod+semicolon exec --no-startup-id Scripts/lc --dmenu -bindsym $mod+Shift+o exec --no-startup-id Scripts/lc common +bindsym $mod+o exec --no-startup-id Scripts/lc goto # Password manager bindsym $mod+p exec --no-startup-id Scripts/lc pass 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% diff --git a/termite/.config/termite/config b/termite/.config/termite/config index 5ab83ee..e2af61a 100644 --- a/termite/.config/termite/config +++ b/termite/.config/termite/config @@ -52,7 +52,7 @@ foreground = #FFFFFF background = #000000 # 20% background transparency (requires a compositor) -background = rgba(0, 0, 0, 0.8) +background = rgba(0, 0, 0, 1) # If unset, will reverse foreground and background highlight = #2f2f2f -- cgit v1.2.3