Refactor codebase to use nix modules
This commit is contained in:
parent
a4735423b4
commit
ffada2703c
114 changed files with 1018 additions and 744 deletions
27
hmModules/apps/hypr/scripts/changeprimary.xsh
Executable file
27
hmModules/apps/hypr/scripts/changeprimary.xsh
Executable file
|
|
@ -0,0 +1,27 @@
|
|||
#!/usr/bin/env xonsh
|
||||
import shelve
|
||||
|
||||
# Usage:
|
||||
# ./changeprimary.xsh workspace
|
||||
# changes to that workspace
|
||||
# if workspace is "etc" then changes to etcN where N is a number
|
||||
|
||||
workspace=$ARG1
|
||||
monitor=$HYPR_MON_PRIMARY
|
||||
|
||||
current_workspace = "home"
|
||||
|
||||
with shelve.open($HYPR_WORK_DB) as db:
|
||||
current_workspace = db.get("primary")
|
||||
if workspace == "etc":
|
||||
if current_workspace.startswith("etc"):
|
||||
current = current_workspace[3:] % db.get("primary_extras")
|
||||
current_workspace = "etc" + str(current)
|
||||
else:
|
||||
current_workspace = "etc0"
|
||||
else:
|
||||
current_workspace = workspace
|
||||
db["primary"] = current_workspace
|
||||
|
||||
hyprctl dispatch moveworkspacetomonitor name:@(current_workspace) $HYPR_MON_PRIMARY >> /dev/null
|
||||
hyprctl dispatch workspace name:@(current_workspace) >> /dev/null
|
||||
27
hmModules/apps/hypr/scripts/changesecondary.xsh
Executable file
27
hmModules/apps/hypr/scripts/changesecondary.xsh
Executable file
|
|
@ -0,0 +1,27 @@
|
|||
#!/usr/bin/env xonsh
|
||||
import shelve
|
||||
import copy
|
||||
|
||||
# Usage:
|
||||
# ./changesecondary.xsh
|
||||
# cycles through the secondary workspaces
|
||||
|
||||
current_secondary = "chat"
|
||||
|
||||
with shelve.open($HYPR_WORK_DB) as db:
|
||||
workspaces = db.get("secondaries").copy()
|
||||
current_primary = db.get("primary")
|
||||
current_secondary = db.get("secondary")
|
||||
#extras = db.get("secondary_extras")
|
||||
|
||||
if current_primary in workspaces:
|
||||
workspaces.remove(current_primary)
|
||||
|
||||
current_secondary = workspaces[
|
||||
(workspaces.index(current_secondary)+1) % len(workspaces)
|
||||
]
|
||||
db["secondary"] = current_secondary
|
||||
|
||||
# Change primary to bind
|
||||
hyprctl dispatch moveworkspacetomonitor name:@(current_secondary) $HYPR_MON_SECONDARY
|
||||
hyprctl dispatch workspace name:@(current_secondary)
|
||||
13
hmModules/apps/hypr/scripts/initdb.xsh
Executable file
13
hmModules/apps/hypr/scripts/initdb.xsh
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
#!/usr/bin/env xonsh
|
||||
import shelve
|
||||
|
||||
# Usage:
|
||||
# ./initdb.xsh
|
||||
# initialize a db for use hypr workspace scripts
|
||||
|
||||
with shelve.open($HYPR_WORK_DB) as db:
|
||||
db["primary"] = "home"
|
||||
db["secondary"] = "chat"
|
||||
db["secondaries"] = ["chat", "web", "med"]
|
||||
db["secondary_extras"] = 1
|
||||
db["primary_extras"] = 1
|
||||
Loading…
Add table
Add a link
Reference in a new issue