77 lines
1.7 KiB
Nu
Executable File
77 lines
1.7 KiB
Nu
Executable File
#!/usr/bin/env nu
|
|
|
|
const REPO_ROOT = path self | path dirname
|
|
|
|
# Quickshell SKYG apps
|
|
def "main" [] {
|
|
help main
|
|
}
|
|
|
|
# Run the app carousel
|
|
def "main carousel" [
|
|
path_to_config: string # path to JSON config
|
|
] {
|
|
$env.SKYG_APP_CAROUSEL = $path_to_config
|
|
qs -p ($REPO_ROOT | path join "app-carousel")
|
|
}
|
|
|
|
const WS_PATH = $REPO_ROOT | path join "workspace-manager"
|
|
|
|
# Send an IPC call to the running workspace manager
|
|
def ws-ipc [fn: string] {
|
|
qs ipc -p $WS_PATH call workspace $fn
|
|
}
|
|
|
|
# Run the workspace manager
|
|
def "main workspace-manager" [
|
|
--daemon (-d) # detach from the terminal
|
|
--config (-c): string # path to JSON config, optional
|
|
] {
|
|
if $config != null {
|
|
$env.SKYG_WORKSPACE_MANAGER = ($config | path expand)
|
|
}
|
|
if $daemon {
|
|
qs -d -n -p $WS_PATH
|
|
} else {
|
|
qs -n -p $WS_PATH
|
|
}
|
|
}
|
|
|
|
# Toggle the workspace carousel. Also closes it.
|
|
def "main workspace-manager toggle" [] {
|
|
ws-ipc "toggle"
|
|
}
|
|
|
|
# Open the workspace carousel
|
|
def "main workspace-manager goto" [] {
|
|
ws-ipc "goTo"
|
|
}
|
|
|
|
# Open the window carousel for the focused workspace
|
|
def "main workspace-manager windows" [] {
|
|
ws-ipc "openWindowSelection"
|
|
}
|
|
|
|
# Open the workspace carousel with the window search bar open
|
|
def "main workspace-manager search" [] {
|
|
ws-ipc "openSearch"
|
|
}
|
|
|
|
const BADGE_PATH = $REPO_ROOT | path join "workspace-badge"
|
|
|
|
# Run the workspace badge: a small box in the corner of each monitor
|
|
def "main workspace-badge" [
|
|
--daemon (-d) # detach from the terminal
|
|
] {
|
|
if $daemon {
|
|
qs -d -n -p $BADGE_PATH
|
|
} else {
|
|
qs -n -p $BADGE_PATH
|
|
}
|
|
}
|
|
|
|
# Open the badge editor on the focused monitor
|
|
def "main workspace-badge edit" [] {
|
|
qs ipc -p $BADGE_PATH call badge edit
|
|
}
|