diff --git a/Bin/screenlayout.sh b/Bin/screenlayout.sh index 992162c..9fa3317 100755 --- a/Bin/screenlayout.sh +++ b/Bin/screenlayout.sh @@ -10,9 +10,9 @@ nextconfig='laptop' case $activeconfig in home) - nextconfig='home-office' + nextconfig='homeoffice' ;; - home-office) + homeoffice) nextconfig='laptop' ;; laptop) @@ -20,6 +20,15 @@ case $activeconfig in ;; esac +if [ $1 ]; then + if [ "$1" = "menu" ]; then + chosen="$(echo -e "$options" | $rofi_command -dmenu -selected-row 1)" + exit 0 + else + nextconfig=$1 + fi +fi + echo ${nextconfig} > ~/.screenlayout.info case $nextconfig in @@ -34,7 +43,7 @@ case $nextconfig in --output DP-2 --off \ --output DP-1 --off ;; - home-office) + homeoffice) # Home Office xrandr --output DP-2-1 --primary --mode 2560x1080 --pos 0x520 --rotate normal \ --output DP-2-2 --mode 1920x1080 --pos 2560x0 --rotate left \ diff --git a/Bin/screenlayoutrofi.sh b/Bin/screenlayoutrofi.sh new file mode 100755 index 0000000..c6868f0 --- /dev/null +++ b/Bin/screenlayoutrofi.sh @@ -0,0 +1,26 @@ +#! /bin/bash + +rofi_command="rofi" +mode="laptop" +### Options ### +laptop=" Laptop only" +home=" Wide screen" +homeoffice="  Dual screen" +# Variable passed to rofi +options="$laptop\n$home\n$homeoffice" + +chosen="$(echo -e "$options" | $rofi_command -dmenu -selected-row 1)" + +case $chosen in + $latpop) + mode="laptop" + ;; + $home) + mode="home" + ;; + $homeoffice) + mode="homeoffice" + ;; +esac + +screenlayout.sh $mode diff --git a/config/i3/config b/config/i3/config index 890d27e..41feb00 100644 --- a/config/i3/config +++ b/config/i3/config @@ -214,6 +214,9 @@ bindsym $mod+x exec "rofi -modi 'find:~/.local/share/rofi/finder.sh' -show find" # Show top bindsym $mod+t exec "rofi -show top -modi top" +# Screen layout +bindsym $mod+p exec "~/Bin/screenlayoutrofi.sh" + # Multimedia keys bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume `pactl info|grep Sink|cut -d: -f 2` +5% bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume `pactl info|grep Sink|cut -d: -f 2` -5%