Compare commits
6 Commits
5599ce14d7
...
316eefe916
| Author | SHA1 | Date | |
|---|---|---|---|
|
316eefe916
|
|||
|
3a821d832b
|
|||
|
b291163a80
|
|||
|
2e2bad65a2
|
|||
|
c46b1c5ea1
|
|||
|
5f40b97e9a
|
@@ -102,12 +102,16 @@ bindsym $mod+6 exec ~/.config/i3/multi-monitor-workspaces.sh -s 6
|
||||
bindsym $mod+7 exec ~/.config/i3/multi-monitor-workspaces.sh -s 7
|
||||
bindsym $mod+8 exec ~/.config/i3/multi-monitor-workspaces.sh -s 8
|
||||
bindsym $mod+9 exec ~/.config/i3/multi-monitor-workspaces.sh -s 9
|
||||
bindsym $mod+0 exec ~/.config/i3/multi-monitor-workspaces.sh -s 0
|
||||
bindsym $mod+0 exec ~/.config/i3/multi-monitor-workspaces.sh -s 10
|
||||
|
||||
# switch back to the previous workspace
|
||||
workspace_auto_back_and_forth yes
|
||||
bindsym $mod+Tab workspace back_and_forth
|
||||
|
||||
# switch workspaces forward and backward
|
||||
bindsym $mod+Next workspace next
|
||||
bindsym $mod+Prior workspace prev
|
||||
|
||||
# Switch visible workspaces (e.g. multi monitor setup)
|
||||
bindsym $mod+Shift+Tab exec i3-msg workspace "$( \
|
||||
i3-msg -t get_workspaces | \
|
||||
@@ -124,7 +128,7 @@ bindsym $mod+Shift+6 exec ~/.config/i3/multi-monitor-workspaces.sh -m 6
|
||||
bindsym $mod+Shift+7 exec ~/.config/i3/multi-monitor-workspaces.sh -m 7
|
||||
bindsym $mod+Shift+8 exec ~/.config/i3/multi-monitor-workspaces.sh -m 8
|
||||
bindsym $mod+Shift+9 exec ~/.config/i3/multi-monitor-workspaces.sh -m 9
|
||||
bindsym $mod+Shift+0 exec ~/.config/i3/multi-monitor-workspaces.sh -m 0
|
||||
bindsym $mod+Shift+0 exec ~/.config/i3/multi-monitor-workspaces.sh -m 10
|
||||
|
||||
# move focused container and switch to workspace
|
||||
bindsym Mod1+Shift+1 exec ~/.config/i3/multi-monitor-workspaces.sh -ms 1
|
||||
@@ -136,7 +140,7 @@ bindsym Mod1+Shift+6 exec ~/.config/i3/multi-monitor-workspaces.sh -ms 6
|
||||
bindsym Mod1+Shift+7 exec ~/.config/i3/multi-monitor-workspaces.sh -ms 7
|
||||
bindsym Mod1+Shift+8 exec ~/.config/i3/multi-monitor-workspaces.sh -ms 8
|
||||
bindsym Mod1+Shift+9 exec ~/.config/i3/multi-monitor-workspaces.sh -ms 9
|
||||
bindsym Mod1+Shift+0 exec ~/.config/i3/multi-monitor-workspaces.sh -ms 0
|
||||
bindsym Mod1+Shift+0 exec ~/.config/i3/multi-monitor-workspaces.sh -ms 10
|
||||
|
||||
# reload the configuration file
|
||||
bindsym $mod+Shift+c reload
|
||||
|
||||
@@ -7,21 +7,19 @@
|
||||
# Print the current working directory of the focused kitty window. Returns 4 if
|
||||
# none exist or is focused.
|
||||
|
||||
socket_path="${TMPDIR:-/tmp}/kitty.$USER/kitty${1:+-$1}.sock"
|
||||
if [ -n "$KITTY_LISTEN_ON" ]; then
|
||||
socket_path="${KITTY_LISTEN_ON#unix:}"
|
||||
else
|
||||
socket_path="${TMPDIR:-/tmp}/kitty.$USER/kitty${1:+-$1}.sock"
|
||||
fi
|
||||
[ -e "$socket_path" ] || exit 1
|
||||
|
||||
# NOTE: the backticks are used for hacky line-continuation, taken from
|
||||
# https://stackoverflow.com/a/7729087/2092762c9
|
||||
kitten @ --to unix:"$socket_path" ls \
|
||||
| jq -er ".[]`
|
||||
` | select(.is_focused).tabs.[]`
|
||||
` | select(.is_focused).windows.[]`
|
||||
` | select(.is_focused).cwd"
|
||||
|
||||
# An alternative version that uses recursive descent to find focused objects
|
||||
# that also have a `.cwd` key:
|
||||
#
|
||||
# | jq -er "..`
|
||||
# ` | objects`
|
||||
# ` | select(.is_focused)`
|
||||
# ` | to_entries.[]`
|
||||
# ` | select(.key == \"cwd\").value"
|
||||
# NOTE: Unfortunately kitten-@-ls(1) is slow, so communicate with the socket
|
||||
# directly.
|
||||
printf '\eP@kitty-cmd{%s,%s,%s}\e\\' \
|
||||
'"cmd":"ls"' \
|
||||
'"version":[0,26,0]' \
|
||||
'"payload":{"match":"state:focused"}' \
|
||||
| nc -U -q0 "$socket_path" \
|
||||
| awk '{ print substr($0, 13, length($0) - 14) }' \
|
||||
| jq -er ".data | fromjson | .[].tabs.[].windows.[].cwd"
|
||||
|
||||
@@ -22,10 +22,11 @@ done
|
||||
if ! pgrep -ax polybar >/dev/null 2>&1; then
|
||||
# launch Polybar on every monitor
|
||||
# https://github.com/polybar/polybar/issues/763
|
||||
while read -r m; do
|
||||
export MONITOR="${m%%:*}"
|
||||
polybar --reload -c "$BASE_DIR/config" main &
|
||||
done <<<"$(polybar --list-monitors)"
|
||||
polybar --list-monitors \
|
||||
| cut -d: -f1 \
|
||||
| xargs -I'{}' -P0 \
|
||||
env MONITOR='{}' \
|
||||
polybar --reload -c "$BASE_DIR/config" main &
|
||||
|
||||
echo "Polybar launched..."
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user