better container moving management, handle xrandr at login
This commit is contained in:
20
bin/auto-outputs
Executable file
20
bin/auto-outputs
Executable file
@@ -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
|
||||
@@ -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/:.*//')
|
||||
|
||||
22
bin/move_to_workspace
Executable file
22
bin/move_to_workspace
Executable file
@@ -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}"
|
||||
Reference in New Issue
Block a user