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 { configuration {
cycle: false; 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"; font: "JetBrainsMono Nerd Font 14";
location: 0; location: 0;
terminal: "alacritty"; terminal: "alacritty";
@ -11,8 +11,8 @@ configuration {
drun-display-format: "{name}"; drun-display-format: "{name}";
display-drun: "  Apps "; display-drun: "  Apps ";
display-run: "  Run "; display-run: "  Run ";
display-window: " 﩯 Window ";
display-workspace: "  Workspace "; display-workspace: "  Workspace ";
display-workspacemove: "  Move to Workspace ";
} }
@theme "tokyonight" @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 #!/usr/bin/env bash
if [ $# -ne 0 ]; then if [ $# -ne 0 ]; then
swaymsg workspace "$@" swaymsg workspace "$@" > /dev/null
else
# Hack to get around weird bug
pkill rofi
exit 0
fi
swaymsg -t get_workspaces | swaymsg -t get_workspaces |
jq -r '.[].name' jq -r 'map(.name) + ["10:browser","20:terminal","30:code","40:files","50:discord","60:settings"] | unique | .[]'
fi

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

View file

@ -76,8 +76,8 @@ in {
filename = ''~/Pictures/$(date +%Y-%m-%d_%H-%M-%S).png''; filename = ''~/Pictures/$(date +%Y-%m-%d_%H-%M-%S).png'';
in pkgs.lib.mkOptionDefault { in pkgs.lib.mkOptionDefault {
"${modifier}+Shift+d" = "exec rofi -show run -config ~/.config/rofi/noicons.rasi"; "${modifier}+Shift+d" = "exec rofi -show run -config ~/.config/rofi/noicons.rasi";
"${modifier}+w" = "exec rofi -show window -config ~/.config/rofi/noicons.rasi"; "${modifier}+w" = "exec rofi -show workspace -config ~/.config/rofi/noicons.rasi";
"${modifier}+Shift+w" = "exec rofi -show workspace -config ~/.config/rofi/noicons.rasi"; "${modifier}+Shift+w" = "exec rofi -show workspacemove -config ~/.config/rofi/noicons.rasi";
"${modifier}+t" = "layout tabbed"; "${modifier}+t" = "layout tabbed";
"${modifier}+Shift+m" = "exec swaylock"; "${modifier}+Shift+m" = "exec swaylock";