Fix bugs with rofi workspace modes

This commit is contained in:
Kiana Sheibani 2023-01-03 22:14:05 -05:00
parent 0c4ce3e936
commit 84c8f5097d
5 changed files with 16 additions and 26 deletions

View file

@ -1,6 +1,6 @@
configuration {
cycle: false;
modi: "drun,run,window:~/.config/rofi/window.sh,workspace:~/.config/rofi/workspace.sh";
modi: "drun,run,workspace:~/.config/rofi/workspace.sh,workspacemove:~/.config/rofi/workspacemove.sh";
font: "JetBrainsMono Nerd Font 14";
location: 0;
terminal: "alacritty";
@ -11,8 +11,8 @@ configuration {
drun-display-format: "{name}";
display-drun: "  Apps ";
display-run: "  Run ";
display-window: " 﩯 Window ";
display-workspace: "  Workspace ";
display-workspacemove: "  Move to Workspace ";
}
@theme "tokyonight"

View file

@ -1,14 +0,0 @@
#!/usr/bin/env bash
if [ $# -ne 0 ]; then
id=$(echo "$@" | cut -d ' ' -f1)
swaymsg "[con_id=$id]" focus
# Hack to get around weird bug
pkill rofi
exit 0
fi
swaymsg -t get_tree |
jq -r '.nodes[].nodes[] | if .nodes then [recurse(.nodes[])] else [] end + .floating_nodes |
.[] | select(.nodes==[]) | ((.id | tostring) + " " + .name)'

View file

@ -1,12 +1,8 @@
#!/usr/bin/env bash
if [ $# -ne 0 ]; then
swaymsg workspace "$@"
# Hack to get around weird bug
pkill rofi
exit 0
swaymsg workspace "$@" > /dev/null
else
swaymsg -t get_workspaces |
jq -r 'map(.name) + ["10:browser","20:terminal","30:code","40:files","50:discord","60:settings"] | unique | .[]'
fi
swaymsg -t get_workspaces |
jq -r '.[].name'

View file

@ -0,0 +1,8 @@
#!/usr/bin/env bash
if [ $# -ne 0 ]; then
swaymsg move container to workspace "$@" > /dev/null
else
swaymsg -t get_workspaces |
jq -r 'map(.name) + ["10:browser","20:terminal","30:code","40:files","50:discord","60:settings"] | unique | .[]'
fi