Skip to content

Instantly share code, notes, and snippets.

View waitimconfused's full-sized avatar
🧠
Busy thinking

Kenneth E waitimconfused

🧠
Busy thinking
  • Canada
View GitHub Profile
#!/bin/bash
RAW_WORKSPACES=$(i3-msg -t get_workspaces | jq)
WORKSPACES=$(i3-msg -t get_workspaces | jq "map(.num|tonumber) | [.[] | select(.>=0)]")
CURRENT=$(echo $RAW_WORKSPACES | jq ".[] | select(.focused==true) | .num")
CURRENT_COUNT=$(i3-msg -t get_tree | jq --arg ws "$(i3-msg -t get_workspaces | jq -r '.[] | select(.focused).name')" '.. | objects | select(.type=="workspace" and .name==$ws) | [.. | objects | select(.window!=null and .sticky==false)] | length')
workspace_error="?"
new_workspace=$workspace_error
{
"reset": "\u001b[0m",
"bold": "\u001b[1m",
"underline": "\u001b[4m",
"black": "\u001b[0;30m",
"black_bold": "\u001b[1;30m",
"black_underline": "\u001b[4;30m",
"black_background": "\u001b[40m",