Add menu to change screen layouts

This commit is contained in:
Jake Howard 2019-10-14 13:31:53 +01:00
parent 76d190e151
commit e4dae72d77
Signed by: jake
GPG key ID: 57AFB45680EDD477
5 changed files with 28 additions and 0 deletions

15
files/bin/rofi-screenlayout Executable file
View file

@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -e
LAYOUTS_DIR=$HOME/.config/screen-layouts
IFS=
layouts=$(find $LAYOUTS_DIR -name "*.sh" | xargs realpath --relative-to $LAYOUTS_DIR)
chosen_layout=$(echo -e $layouts | rofi -dmenu -p "Select Layout" -no-custom -lines 5)
chosen_layout_file="${LAYOUTS_DIR}/${chosen_layout}"
echo "Setting layout to ${chosen_layout}"
bash $chosen_layout_file
i3-msg restart

View file

@ -40,6 +40,7 @@ bindsym Control+Shift+Escape exec --no-startup-id gnome-system-monitor
bindsym Control+Q exec --no-startup-id /bin/false bindsym Control+Q exec --no-startup-id /bin/false
bindsym $mod+Shift+Delete exec --no-startup-id rofi-powermenu bindsym $mod+Shift+Delete exec --no-startup-id rofi-powermenu
bindcode 124 exec --no-startup-id rofi-powermenu bindcode 124 exec --no-startup-id rofi-powermenu
bindsym $mod+P exec --no-startup-id rofi-screenlayout
# Screenshots # Screenshots

View file

@ -0,0 +1,2 @@
#!/bin/sh
xrandr --output eDP-1 --primary --mode 1920x1200 --pos 0x322 --rotate normal --output DP-1 --off --output HDMI-1 --mode 1920x1080 --pos 3839x0 --rotate normal --output DP-2 --off --output HDMI-2 --mode 1920x1080 --pos 1920x0 --rotate normal

View file

@ -0,0 +1,2 @@
#!/bin/sh
xrandr --output eDP-1 --primary --mode 1920x1200 --pos 0x322 --rotate normal --output DP-1 --off --output HDMI-1 --off --output DP-2 --off --output HDMI-2 --off

View file

@ -96,3 +96,11 @@
dest: /usr/bin/pranklock dest: /usr/bin/pranklock
mode: 0755 mode: 0755
force: true force: true
- name: Install Screen Layouts
copy:
src: ./files/screen-layouts
dest: "{{ home }}/.config"
mode: 0755
directory_mode: 0755
owner: "{{ user }}"