Skip to content
Merged
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
27 changes: 27 additions & 0 deletions bin/omarchy-toggle-fullscreen-desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

# omarchy:summary=Toggle a full screen desktop: hide the top bar and remove the window gaps together
# omarchy:args=[toggle|on|off]
# omarchy:examples=omarchy toggle fullscreen desktop | omarchy toggle fullscreen desktop off | omarchy toggle fullscreen desktop on

ACTION="${1:-toggle}"

case $ACTION in
toggle|"")
# Only leave full screen when both halves are already in it, so a lone bar
# or a lone gap toggle is pulled into line rather than flipped away.
if omarchy-toggle-enabled bar-off && omarchy-hyprland-toggle-enabled window-no-gaps; then
ACTION="off"
else
ACTION="on"
fi
;;
on|off) ;;
*)
echo "Usage: omarchy-toggle-fullscreen-desktop [toggle|on|off]" >&2
exit 1
;;
esac

omarchy-toggle-bar "$ACTION"
omarchy-hyprland-toggle window-no-gaps "$ACTION"
1 change: 1 addition & 0 deletions default/hypr/bindings/utilities.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ o.bind("SUPER + SHIFT + CTRL + SPACE", "Theme menu", "omarchy-menu toggle theme"
o.bind("SUPER + BACKSPACE", "Toggle window transparency", "omarchy-hyprland-window-transparency-toggle")
o.bind("SUPER + SHIFT + BACKSPACE", "Toggle window gaps", "omarchy-hyprland-window-gaps-toggle")
o.bind("SUPER + CTRL + BACKSPACE", "Toggle single-window square aspect", "omarchy-hyprland-window-single-square-aspect-toggle")
o.bind_toggle("SUPER + CTRL + ALT + F", "Toggle full screen desktop", "fullscreen-desktop")

-- xkbcommon names the comma keysym "comma"; the upper-case "COMMA" does not match.
o.bind("SUPER + comma", "Dismiss last notification", "omarchy-shell notifications dismissOne")
Expand Down
1 change: 1 addition & 0 deletions manual/07-hotkeys.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ All style options are also accessible under _Style_ in the Omarchy menu (`Super
| `Shift + Mute` | Switch to next audio output |
| `Shift + Play` | Switch to next media source |
| `Super + Shift + Backspace` | Toggle window gaps |
| `Super + Ctrl + Alt + F` | Toggle full screen desktop (top bar + window gaps) |

## Reminders

Expand Down
33 changes: 33 additions & 0 deletions test/shell.d/toggle-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,36 @@ pass "bar on is idempotent"
HOME="$test_home" omarchy-toggle-bar off
[[ ! -f $bar_flag ]] || fail "bar off disables bar-off toggle"
pass "bar off disables bar-off toggle"

# The gaps half of full screen copies a flag file in and reloads Hyprland, so
# give it this checkout to copy from and a hyprctl that answers without a
# compositor.
export OMARCHY_PATH="$ROOT"
stub_bin="$TMPDIR/bin"
mkdir -p "$stub_bin"
printf '#!/bin/bash\nexit 0\n' >"$stub_bin/hyprctl"
chmod +x "$stub_bin/hyprctl"
export PATH="$stub_bin:$PATH"

gaps_flag="$test_home/.local/state/omarchy/toggles/hypr/window-no-gaps.lua"

HOME="$test_home" omarchy-toggle-fullscreen-desktop
[[ -f $bar_flag && -f $gaps_flag ]] || fail "fullscreen toggle hides the bar and the gaps together"
pass "fullscreen toggle hides the bar and the gaps together"

HOME="$test_home" omarchy-toggle-fullscreen-desktop
[[ ! -f $bar_flag && ! -f $gaps_flag ]] || fail "fullscreen toggle restores the bar and the gaps together"
pass "fullscreen toggle restores the bar and the gaps together"

HOME="$test_home" omarchy-toggle-bar on
HOME="$test_home" omarchy-toggle-fullscreen-desktop
[[ -f $bar_flag && -f $gaps_flag ]] || fail "fullscreen toggle pulls a half-hidden desktop into full screen"
pass "fullscreen toggle pulls a half-hidden desktop into full screen"

HOME="$test_home" omarchy-toggle-fullscreen-desktop off
[[ ! -f $bar_flag && ! -f $gaps_flag ]] || fail "fullscreen off leaves full screen"
pass "fullscreen off leaves full screen"

HOME="$test_home" omarchy-toggle-fullscreen-desktop on
[[ -f $bar_flag && -f $gaps_flag ]] || fail "fullscreen on enters full screen"
pass "fullscreen on enters full screen"