diff --git a/bin/auto-outputs b/bin/auto-outputs new file mode 100755 index 0000000..4736ae2 --- /dev/null +++ b/bin/auto-outputs @@ -0,0 +1,20 @@ +#! /bin/bash + +. ~/.config/i3/env + +usage() { + echo "usage: auto-outputs" +} + +if [ $# -ne 0 ]; then + usage; exit 1 +fi + +xrandr --auto +if [ -n "${PRIMARY_OUTPUT}" ] && [ -n "${SECONDARY_OUTPUT}" ]; then + if [ -n "${SECONDARY_OUTPUT_POSITION}" ]; then + xrandr --output ${PRIMARY_OUTPUT} --primary --output ${SECONDARY_OUTPUT} ${SECONDARY_OUTPUT_POSITION} HDMI-1 + else + xrandr --output ${PRIMARY_OUTPUT} --primary --output ${SECONDARY_OUTPUT} --right-of HDMI-1 + fi +fi diff --git a/bin/menu_workspace_switch b/bin/menu_workspace_switch index b2520d6..1ee9f5b 100755 --- a/bin/menu_workspace_switch +++ b/bin/menu_workspace_switch @@ -1,3 +1,3 @@ #!/bin/bash -ROFI_INPUT=1 ~/.config/i3/bin/focus_workspace $(i3-msg -t get_workspaces | jq '.[]' | jq -r '.name' | rofi -dmenu -p "Select workspace:" | sed 's/:.*//') +ROFI_INPUT=1 ~/.config/i3/bin/focus_workspace $(i3-msg -t get_workspaces | jq '.[]' | jq -r '.name' | sort -n | rofi -dmenu -p "Select workspace:" | sed 's/:.*//') diff --git a/bin/move_to_workspace b/bin/move_to_workspace new file mode 100755 index 0000000..b680964 --- /dev/null +++ b/bin/move_to_workspace @@ -0,0 +1,22 @@ +#! /bin/bash + +. ~/.config/i3/env + +usage() { + echo "usage: move_to_workspace [1-9]" +} + +if [ $# -ne 1 ]; then + usage; exit 1 +fi + +CURRENT_OUTPUT=$(i3-msg -t get_workspaces | jq -r ".[] | select(.focused==true).output") + +if [ $1 -gt 0 ] && [ $1 -lt 43 ]; then + NEXT_WORKSPACE=$1 + [ ${CURRENT_OUTPUT} == "${SECONDARY_OUTPUT}" ] && NEXT_WORKSPACE=$((10 + $1)) +else + usage; exit 1 +fi + +i3-msg -q "move container to workspace ${NEXT_WORKSPACE}" diff --git a/config b/config index efae584..42b1bd9 100644 --- a/config +++ b/config @@ -1,7 +1,8 @@ set $mod Mod4 floating_modifier $mod -exec --no-startup-id "~/.config/i3/bin/create_workspaces" +exec --no-startup-id ~/.config/i3/bin/auto-outputs +exec --no-startup-id ~/.config/i3/bin/create_workspaces ########## # Visual # @@ -22,7 +23,7 @@ exec --no-startup-id "xbindkeys > /dev/null 2>&1" exec --no-startup-id "nm-applet > /dev/null 2>&1" exec --no-startup-id "pasystray > /dev/null 2>&1" exec --no-startup-id "blueman-applet > /dev/null 2>&1" -exec --no-startup-id "compton > /dev/null 2>&1" +exec --no-startup-id "compton -b > /dev/null 2>&1" exec --no-startup-id "xss-lock slock" ############ @@ -70,15 +71,15 @@ bindsym $mod+7 exec ~/.config/i3/bin/focus_workspace 7 bindsym $mod+8 exec ~/.config/i3/bin/focus_workspace 8 bindsym $mod+9 exec ~/.config/i3/bin/focus_workspace 9 # move focused container to workspace -bindsym $mod+Shift+1 move container to workspace number 1 -bindsym $mod+Shift+2 move container to workspace number 2 -bindsym $mod+Shift+3 move container to workspace number 3 -bindsym $mod+Shift+4 move container to workspace number 4 -bindsym $mod+Shift+5 move container to workspace number 5 -bindsym $mod+Shift+6 move container to workspace number 6 -bindsym $mod+Shift+7 move container to workspace number 7 -bindsym $mod+Shift+8 move container to workspace number 8 -bindsym $mod+Shift+9 move container to workspace number 9 +bindsym $mod+Shift+1 exec ~/.config/i3/bin/move_to_workspace 1 +bindsym $mod+Shift+2 exec ~/.config/i3/bin/move_to_workspace 2 +bindsym $mod+Shift+3 exec ~/.config/i3/bin/move_to_workspace 3 +bindsym $mod+Shift+4 exec ~/.config/i3/bin/move_to_workspace 4 +bindsym $mod+Shift+5 exec ~/.config/i3/bin/move_to_workspace 5 +bindsym $mod+Shift+6 exec ~/.config/i3/bin/move_to_workspace 6 +bindsym $mod+Shift+7 exec ~/.config/i3/bin/move_to_workspace 7 +bindsym $mod+Shift+8 exec ~/.config/i3/bin/move_to_workspace 8 +bindsym $mod+Shift+9 exec ~/.config/i3/bin/move_to_workspace 9 # switch/move to output bindsym $mod+s focus output right bindsym $mod+Shift+s move container to output right