Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions desktop/shell/bin/omarchy-rotate
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env python3
"""Manual rotation uses the same output protocol as auto-rotation; holds auto until unlock."""
import json, os, subprocess, sys
from pathlib import Path
mode = sys.argv[1] if len(sys.argv)>1 else 'status'
outputs = json.loads(subprocess.check_output(['wlr-randr', '--json'], text=True))
panel = next((o for o in outputs if o['name'] == 'eDP-1'), None)
if panel is None:
panel = next(o for o in outputs if o.get('enabled'))
current = panel['transform']
turns = ['normal', '90', '180', '270']
if mode == 'status':
print(current); raise SystemExit(0)
if mode == 'next': mode = turns[(turns.index(current)+1)%4]
mode = {'portrait':'normal','landscape':'90','portrait-flipped':'180','landscape-flipped':'270'}.get(mode,mode)
if mode not in turns: raise SystemExit('Usage: omarchy-rotate status|next|normal|90|180|270')
lock = Path(os.environ.get('XDG_CONFIG_HOME', str(Path.home()/'.config')))/'omarchy/rotation-lock'
was_locked = lock.exists()
lock.parent.mkdir(parents=True,exist_ok=True); lock.touch()
try:
subprocess.run(['wlr-randr','--output',panel['name'],'--transform',mode],check=True,timeout=5)
except (OSError, subprocess.SubprocessError):
if not was_locked: lock.unlink(missing_ok=True)
raise
2 changes: 2 additions & 0 deletions desktop/shell/default/omarchy/omarchy-menu.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@
"trigger.tests.disk-speedtest": {"icon":"󰋊","label":"Disk Speed Test","action":"omarchy-shell shell summon omarchy.disk-speedtest"},

// Setup
"setup.tablet": {"icon":"󰦧","label":"Tablet"},
"setup.tablet.rotate": {"icon":"󰑢","label":"Rotate Once and Lock","action":"omarchy-rotate next"},
"setup.monitors": {"icon":"󰍹","label":"Monitors","action":"omarchy-launch-config-editor \"$HOME/.config/hypr/monitors.lua\""},
"setup.keybindings": {"icon":"","label":"Keybindings","when":"[[ -f ~/.config/hypr/bindings.lua ]]","action":"omarchy-launch-config-editor \"$HOME/.config/hypr/bindings.lua\""},
"setup.input": {"icon":"","label":"Input","when":"[[ -f ~/.config/hypr/input.lua ]]","action":"omarchy-launch-config-editor \"$HOME/.config/hypr/input.lua\""},
Expand Down
13 changes: 9 additions & 4 deletions release/public_root.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def desktop_replacements():
replacements['home/tablet/.config/labwc/rc.xml'] = (PROJECT / 'desktop/shell/labwc-rc.xml').read_bytes()
replacements['home/tablet/.config/labwc/autostart'] = (PROJECT / 'desktop/configuration/labwc-autostart').read_bytes()
replacements['usr/local/libexec/arch-ipad-rotate-output'] = (PROJECT / 'desktop/configuration/rotate-output').read_bytes()
replacements[prefix + 'default/omarchy/omarchy-menu.jsonc'] = (PROJECT / 'desktop/shell/default/omarchy/omarchy-menu.jsonc').read_bytes()
return replacements


Expand Down Expand Up @@ -129,10 +130,14 @@ def labwc_files(directory, architecture='aarch64'):


def desktop_additions():
name = 'home/tablet/.local/share/omarchy-ipad/shell/bluetooth-pairing/shell.qml'
return {name: ((PROJECT / 'desktop/shell/shell/bluetooth-pairing/shell.qml').read_bytes(), 0o644),
'home/tablet/.local/share/omarchy-ipad/bin/omarchy-rotation-lock':
((PROJECT / 'desktop/shell/bin/omarchy-rotation-lock').read_bytes(), 0o755)}
prefix = 'home/tablet/.local/share/omarchy-ipad/'
return {
'usr/local/bin/omarchy-rotate': ((PROJECT / 'desktop/shell/bin/omarchy-rotate').read_bytes(), 0o755),
'home/tablet/.local/share/omarchy-ipad/bin/omarchy-rotate': ((PROJECT / 'desktop/shell/bin/omarchy-rotate').read_bytes(), 0o755),
'usr/local/bin/omarchy-rotation-lock': ((PROJECT / 'desktop/shell/bin/omarchy-rotation-lock').read_bytes(), 0o755),
'home/tablet/.local/share/omarchy-ipad/bin/omarchy-rotation-lock': ((PROJECT / 'desktop/shell/bin/omarchy-rotation-lock').read_bytes(), 0o755),
'home/tablet/.local/share/omarchy-ipad/shell/bluetooth-pairing/shell.qml': ((PROJECT / 'desktop/shell/shell/bluetooth-pairing/shell.qml').read_bytes(), 0o644),
}


def system_files():
Expand Down
Loading