add waybar config, scripts, mic tweaks
This commit is contained in:
35
dot_local/bin/executable_assign-workspace-monitors
Normal file
35
dot_local/bin/executable_assign-workspace-monitors
Normal file
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import json
|
||||
import subprocess
|
||||
|
||||
CONFIG = {
|
||||
'Samsung Electric Company LS27A800U HCJW301093': 1,
|
||||
'Seanix Technology Inc NX-EDG27X C6F0K3CN07UL': 2,
|
||||
'BOE 0x0BCA': 3
|
||||
}
|
||||
|
||||
|
||||
p = subprocess.run(
|
||||
['hyprctl', 'monitors', '-j'],
|
||||
capture_output=True,
|
||||
check=True,
|
||||
encoding='utf-8'
|
||||
)
|
||||
monitors = json.loads(p.stdout)
|
||||
print('monitors:', monitors)
|
||||
|
||||
if set(m['description'] for m in monitors) == CONFIG.keys():
|
||||
print('config matched, assigning:')
|
||||
dispatches = []
|
||||
for m in monitors:
|
||||
workspace = CONFIG[m['description']]
|
||||
# move workspace to desired monitor
|
||||
dispatches.append(f"dispatch moveworkspacetomonitor {workspace} {m['name']}")
|
||||
# focus the workspace so that it's visible after moving
|
||||
dispatches.append(f"workspace {workspace}")
|
||||
cmd = ['hyprctl', '--batch', ' ; '.join(dispatches)]
|
||||
print('\n'.join(cmd))
|
||||
subprocess.run(cmd, check=True)
|
||||
else:
|
||||
print('config not matched')
|
4
dot_local/bin/executable_clear-downloads
Normal file
4
dot_local/bin/executable_clear-downloads
Normal file
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# clear all files in ~/Downloads older than 24h
|
||||
fd --changed-before 1d --full-path ~/Downloads --exec-batch rm -rf
|
7
dot_local/bin/executable_new-workspace
Normal file
7
dot_local/bin/executable_new-workspace
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# current highest-numbered workspace
|
||||
MAX_WORKSPACE=$(hyprctl workspaces -j | jq 'sort_by(.id) | reverse | .[0].id')
|
||||
|
||||
hyprctl dispatch workspace $(($MAX_WORKSPACE + 1))
|
||||
|
Reference in New Issue
Block a user