Last active
February 21, 2023 22:15
-
-
Save krkhan/a6df8684eb8f9db8d1ab25e0168f54b0 to your computer and use it in GitHub Desktop.
hidden workspaces
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/modules/i3.cpp b/src/modules/i3.cpp | |
index 383a39f..e16d2ab 100644 | |
--- a/src/modules/i3.cpp | |
+++ b/src/modules/i3.cpp | |
@@ -160,6 +160,15 @@ namespace modules { | |
// Trim leading and trailing whitespace | |
ws_name = string_util::trim(move(ws_name), ' '); | |
+ if (ws_name.back() == '_' && !ws->visible) { | |
+ continue; | |
+ } | |
+ | |
+ if (ws_name.back() == '_') { | |
+ ws_name.pop_back(); | |
+ ws_name += " (hidden)"; | |
+ } | |
+ | |
auto icon = m_icons->get(ws->name, DEFAULT_WS_ICON, m_fuzzy_match); | |
auto label = m_statelabels.find(ws_state)->second->clone(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function gen_workspaces() | |
{ | |
i3-msg -t get_workspaces | \jq -r '.[].name' | |
} | |
WORKSPACE=$( gen_workspaces | rofi -dmenu -p "Select workspace:") | |
if [ -n "${WORKSPACE}" ] | |
then | |
i3-msg workspace "${WORKSPACE}" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Related to i3/i3#2333
polybar
![image](https://user-images.githubusercontent.com/697967/80146488-c666b680-8566-11ea-88d9-5fca0fa14edd.png)
rofi
![image](https://user-images.githubusercontent.com/697967/80146500-c9fa3d80-8566-11ea-848b-bbd8ef21b6ec.png)