Update eww config

This commit is contained in:
ItsDrike 2022-11-19 22:14:12 +01:00
parent efe9388a41
commit 52213e5eed
No known key found for this signature in database
GPG key ID: B014E761034AF742
3 changed files with 11 additions and 2 deletions

6
home/.config/eww/scripts/temp Executable file
View file

@ -0,0 +1,6 @@
#!/bin/bash
# shellcheck source=include
source "./scripts/include"
hyprland_ipc "workspace|createworkspace|destroyworkspace|activewindow"

View file

@ -54,7 +54,7 @@ REMAP_RULES: list[RemapRule] = [
RemapRule(r"(?:\[\d+\] )?\*?WebCord - (.+)", "{}", "WebCord"),
RemapRule(r"(.+) - Discord", "{}", "discord"),
RemapRule(r"(.+) - mpv", "{}", "mpv"),
RemapRule(r"Stremio - (.+)", " Stremio - {}", "com.stremio.stremio"),
RemapRule(r"Stremio - (.+)", " Stremio - {}", "Stremio"),
RemapRule(r"Spotify", " Spotify", "Spotify"),
RemapRule(r"pulsemixer", " Pulsemixer"),
RemapRule(r"(.*)", "{}", "Pcmanfm"),

View file

@ -44,6 +44,7 @@ class MonitorInfo(TypedDict):
class OutputWorkspaceInfo(WorkspaceInfo):
format_name: str
active: bool
monitor_id: int
# workspace id -> remapped name
@ -94,6 +95,7 @@ def fill_blank_workspaces(open: list[OutputWorkspaceInfo]) -> list[OutputWorkspa
"lastwindowtitle": "N/A",
"active": False,
"format_name": format_name,
"monitor_id": 0,
}
lst.append(blank_ws)
@ -118,7 +120,8 @@ def get_workspaces() -> list[OutputWorkspaceInfo]:
continue
format_name = REMAPS.get(workspace["id"], workspace["name"])
active = workspace["id"] in active_workspaces
out.append({**workspace, "format_name": format_name, "active": active})
mon_id = [monitor["id"] for monitor in monitors if monitor["name"] == workspace["monitor"]][0]
out.append({**workspace, "format_name": format_name, "active": active, "monitor_id": mon_id})
out = fill_blank_workspaces(out)
out.sort(key=workspace_sort)