From a3c08fd0f02967242780ff9c512a5881b4591461 Mon Sep 17 00:00:00 2001 From: Ezri Brimhall Date: Tue, 22 Oct 2024 15:10:09 -0600 Subject: [PATCH] Tycho migration to context manager --- .config/eww/modules/workspaces.yuck | 2 +- .config/sway/config | 28 ++ ...-gaps.conf##class.has-sidebar-5-workspaces | 11 + .config/sway/workspaces.json##hostname.tycho | 323 ++++++++++-------- .local/bin/default-application-launcher | 5 +- 5 files changed, 221 insertions(+), 148 deletions(-) create mode 100644 .config/sway/local-config.d/50-sidebar-gaps.conf##class.has-sidebar-5-workspaces diff --git a/.config/eww/modules/workspaces.yuck b/.config/eww/modules/workspaces.yuck index ede6b3b..7828d0e 100644 --- a/.config/eww/modules/workspaces.yuck +++ b/.config/eww/modules/workspaces.yuck @@ -1,6 +1,6 @@ ;; -*-lisp-*- (deflisten sway--data :initial '{"mode": "default"}' - `~/.config/eww/scripts/sway.py`) + `sway_listen`) (defvar hypr--data '{}') diff --git a/.config/sway/config b/.config/sway/config index baf6bb9..4b8d55b 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -61,6 +61,34 @@ mode "resize" { } } +## Workspace Switching Keybinds +bindsym { + $mod+1 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager FocusWorkspace y 1 + $mod+2 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager FocusWorkspace y 2 + $mod+3 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager FocusWorkspace y 3 + $mod+4 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager FocusWorkspace y 4 + $mod+5 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager FocusWorkspace y 5 + $mod+6 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager FocusWorkspace y 6 + $mod+7 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager FocusWorkspace y 7 + $mod+8 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager FocusWorkspace y 8 + $mod+9 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager FocusWorkspace y 9 + $mod+0 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager FocusWorkspace y 10 +} + +## Window Reassignment Keybinds +bindsym { + $mod+Shift+1 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager MoveContainer y 1 + $mod+Shift+2 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager MoveContainer y 2 + $mod+Shift+3 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager MoveContainer y 3 + $mod+Shift+4 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager MoveContainer y 4 + $mod+Shift+5 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager MoveContainer y 5 + $mod+Shift+6 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager MoveContainer y 6 + $mod+Shift+7 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager MoveContainer y 7 + $mod+Shift+8 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager MoveContainer y 8 + $mod+Shift+9 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager MoveContainer y 9 + $mod+Shift+0 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager MoveContainer y 10 +} + bindsym $mod+r mode "resize" ## Moving Windows diff --git a/.config/sway/local-config.d/50-sidebar-gaps.conf##class.has-sidebar-5-workspaces b/.config/sway/local-config.d/50-sidebar-gaps.conf##class.has-sidebar-5-workspaces new file mode 100644 index 0000000..7c2196d --- /dev/null +++ b/.config/sway/local-config.d/50-sidebar-gaps.conf##class.has-sidebar-5-workspaces @@ -0,0 +1,11 @@ +#### -*-conf-space-*- #### +## Sidebar Gaps Config ## +#### #### + +workspace { + 1 gaps left 210 + 2 gaps left 210 + 3 gaps left 210 + 4 gaps left 210 + 5 gaps left 210 +} diff --git a/.config/sway/workspaces.json##hostname.tycho b/.config/sway/workspaces.json##hostname.tycho index 621ad33..fc9c249 100644 --- a/.config/sway/workspaces.json##hostname.tycho +++ b/.config/sway/workspaces.json##hostname.tycho @@ -1,161 +1,196 @@ { "default_context": "work", - "display_ordering": ["left", "center", "right"], - "display_layout": { - "left": "DP-5", - "right": "DP-7", - "center": "DP-4" - }, + "workspaces": [ + { + "index": 1, + "name": "console", + "exec": "console", + "program_name": "console" + }, + { + "index": 2, + "name": "code", + "exec": "emacsclient", + "args": ["-nc"], + "program_name": "emacsclient" + }, + { + "index": 3, + "name": "documentation", + "exec": "firefox", + "args": ["--new-window"], + "environ": {}, + "program_name": "firefox" + }, + { + "index": 4, + "name": "project", + "exec": "firefox", + "args": ["--new-window"], + "program_name": "firefox" + }, + { + "index": 5, + "name": "discord", + "exec": "discord", + "program_name": "discord" + }, + { + "index": 6, + "name": "console", + "exec": "console", + "program_name": "console" + }, + { + "index": 7, + "name": "code", + "exec": "emacsclient", + "args": ["-nc"], + "program_name": "emacsclient" + }, + { + "index": 8, + "name": "internet", + "exec": "firefox", + "args": ["--new-window"], + "program_name": "firefox" + }, + { + "index": 9, + "name": "project", + "exec": "firefox-developer-edition", + "args": ["-start-debugger-server", "--new-window"], + "program_name": "firefox-developer-edition" + }, + { + "index": 10, + "name": "server management", + "exec": "virt-manager", + "program_name": "virt-manager", + "systemd": false + }, + { + "index": 11, + "name": "password management", + "exec": "bitwarden-desktop", + "program_name": "bitwarden" + }, + { + "index": 12, + "name": "video", + "exec": "jellyfinmediaplayer", + "program_name": "jellyfinmediaplayer" + }, + { + "index": 13, + "name": "edex-ui", + "exec": "edex-ui", + "program_name": "edex-ui" + }, + { + "index": 14, + "name": "mail", + "exec": "thunderbird", + "program_name": "thunderbird", + "environ": { + "MOZ_ENABLE_WAYLAND": "1" + } + }, + { + "index": 15, + "name": "config", + "exec": "console", + "program_name": "console" + }, + { + "index": 16, + "name": "console", + "exec": "console", + "program_name": "console" + }, + { + "index": 17, + "name": "code", + "exec": "emacsclient", + "args": ["-nc"], + "program_name": "emacsclient" + }, + { + "index": 18, + "name": "music", + "exec": "feishin", + "program_name": "feishin" + }, + { + "index": 19, + "name": "project", + "exec": "firefox", + "args": ["--new-window"], + "program_name": "firefox" + }, + { + "index": 20, + "name": "slack", + "exec": "slack", + "program_name": "slack", + "args": [ + "--enable-features=UseOzonePlatform", + "--ozone-platform=wayland", + "--enable-gpu-rasterization" + ], + "memory_profile": { + "high": "800M", + "max": "1.2G" + } + } + ], "contexts": { "work": { - "left": [ + "primary": "center", + "outputs": [ { - "index": 5, - "name": "discord", - "exec": "discord", - "program_name": "discord" + "make": "HP Inc.", + "model": "HP Z27n G2", + "serial": "6CM0151FHY", + "group": "left", + "position": [0, 450], + "mode": "2560x1440@60Hz", + "eww_windows": ["sidebar", "leftbar"] }, { - "index": 4, - "name": "project", - "exec": "firefox", - "args": ["--new-window"], - "program_name": "firefox" + "make": "Hewlett Packard", + "model": "HP S340c", + "serial": "CN490508SQ", + "group": "center", + "position": [2560, 450], + "mode": "3440x1440", + "eww_windows": ["centerbar"] }, { - "index": 3, - "name": "documentation", - "exec": "firefox", - "args": ["--new-window"], - "environ": {}, - "program_name": "firefox" - }, - { - "index": 2, - "name": "code", - "exec": "emacsclient", - "args": ["-nc"], - "program_name": "emacsclient" - }, - { - "index": 1, - "name": "console", - "exec": "console", - "program_name": "console" + "make": "HP Inc.", + "model": "HP Z27n G2", + "serial": "6CM0151FD4", + "group": "right", + "position": [6000, 0], + "mode": "2560x1440@60Hz", + "transform": 90, + "eww_windows": ["rightbar"] } ], - "center": [ - { - "index": 6, - "name": "console", - "exec": "console", - "program_name": "console" + "groups": { + "left": { + "workspaces": [1, 2, 3, 4, 5], + "reverse": true }, - { - "index": 7, - "name": "code", - "exec": "emacsclient", - "args": ["-nc"], - "program_name": "emacsclient" + "center": { + "workspaces": [6, 7, 8, 9, 10, 11, 12, 13, 14, 15], + "reverse": false }, - { - "index": 8, - "name": "internet", - "exec": "firefox", - "args": ["--new-window"], - "program_name": "firefox" - }, - { - "index": 9, - "name": "project", - "exec": "firefox-developer-edition", - "args": ["-start-debugger-server", "--new-window"], - "program_name": "firefox-developer-edition" - }, - { - "index": 10, - "name": "server management", - "exec": "virt-manager", - "program_name": "virt-manager", - "systemd": false - }, - { - "index": 11, - "name": "password management", - "exec": "bitwarden-desktop", - "program_name": "bitwarden" - }, - { - "index": 12, - "name": "video", - "exec": "jellyfinmediaplayer", - "program_name": "jellyfinmediaplayer" - }, - { - "index": 13, - "name": "edex-ui", - "exec": "edex-ui", - "program_name": "edex-ui" - }, - { - "index": 14, - "name": "mail", - "exec": "thunderbird", - "program_name": "thunderbird", - "environ": { - "MOZ_ENABLE_WAYLAND": "1" - } - }, - { - "index": 15, - "name": "config", - "exec": "console", - "program_name": "console" + "right": { + "workspaces": [16, 17, 18, 19, 20], + "reverse": false } - ], - "right": [ - { - "index": 16, - "name": "console", - "exec": "console", - "program_name": "console" - }, - { - "index": 17, - "name": "code", - "exec": "emacsclient", - "args": ["-nc"], - "program_name": "emacsclient" - }, - { - "index": 18, - "name": "music", - "exec": "feishin", - "program_name": "feishin" - }, - { - "index": 19, - "name": "project", - "exec": "firefox", - "args": ["--new-window"], - "program_name": "firefox" - }, - { - "index": 20, - "name": "slack", - "exec": "slack", - "program_name": "slack", - "args": [ - "--enable-features=UseOzonePlatform", - "--ozone-platform=wayland", - "--enable-gpu-rasterization" - ], - "memory_profile": { - "high": "800M", - "max": "1.2G" - } - } - ] + } } } } diff --git a/.local/bin/default-application-launcher b/.local/bin/default-application-launcher index f4109ff..37e340b 100755 --- a/.local/bin/default-application-launcher +++ b/.local/bin/default-application-launcher @@ -6,9 +6,8 @@ exec 2> >(systemd-cat -t i3-sensible-launcher -p err) pyenv shell system -current_workspace=$(swaymsg -t get_workspaces | jq '.[] | select(.focused==true).name' -r) - -ws_data=$(jq <$HOME/.config/sway/workspaces.json ".contexts | [.[] | values[]] | flatten(1) | .[] | select(.index==${current_workspace})" -c) +ws_data=$(sway_get_focused_workspace) +current_workspace=$(echo $ws_data | jq -r '.index') program=$(echo $ws_data | jq -r '.exec') program_name=$(echo $ws_data | jq -r '.program_name')