Skip to content

Instantly share code, notes, and snippets.

@krkhan
Last active February 21, 2023 22:15
Show Gist options
  • Save krkhan/a6df8684eb8f9db8d1ab25e0168f54b0 to your computer and use it in GitHub Desktop.
Save krkhan/a6df8684eb8f9db8d1ab25e0168f54b0 to your computer and use it in GitHub Desktop.
hidden workspaces
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();
#!/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
@krkhan
Copy link
Author

krkhan commented Apr 23, 2020

Related to i3/i3#2333

polybar
image

rofi
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment