mirror of
https://github.com/ItsDrike/nixdots
synced 2024-12-25 17:24:35 +00:00
Add toggle-fake-fullscreen script
This commit is contained in:
parent
036b1a9064
commit
3cb701b042
|
@ -20,6 +20,7 @@
|
|||
"SUPER, F, togglefloating,"
|
||||
"SUPER, Space, fullscreen, 0"
|
||||
"SUPER_SHIFT, Space, fullscreen, 1" # maximize
|
||||
"CTRL_SHIFT, Space, exec, toggle-fake-fullscreen" # fake fullscreen + custom border
|
||||
"SUPER_SHIFT, S, layoutmsg, togglesplit"
|
||||
|
||||
#
|
||||
|
|
|
@ -19,9 +19,10 @@ in {
|
|||
hyprPkgs.hyprland-move-window
|
||||
hyprPkgs.hyprland-screenshot
|
||||
hyprPkgs.quick-record
|
||||
hyprPkgs.toggle-fake-fullscreen
|
||||
hyprPkgs.brightness
|
||||
pkgs.brightnessctl
|
||||
pkgs.hyprpicker
|
||||
hyprPkgs.brightness
|
||||
];
|
||||
|
||||
wayland.windowManager.hyprland = {
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
brightness = pkgs.callPackage ./brightness {};
|
||||
hyprland-screenshot = pkgs.callPackage ./hyprland-screenshot {};
|
||||
quick-record = pkgs.callPackage ./quick-record {};
|
||||
toggle-fake-fullscreen = pkgs.callPackage ./toggle-fake-fullscreen {};
|
||||
};
|
||||
in
|
||||
packages
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
{pkgs, ...}:
|
||||
pkgs.writeShellApplication {
|
||||
name = "toggle-fake-fullscreen";
|
||||
runtimeInputs = with pkgs; [
|
||||
coreutils
|
||||
jq
|
||||
hyprland
|
||||
];
|
||||
text = ''
|
||||
${builtins.readFile ./toggle-fake-fullscreen.sh}
|
||||
'';
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
#ACTIVE_BORDER_COLOR="0xFF327BD1"
|
||||
ACTIVE_BORDER_COLOR="0xFFFF6600"
|
||||
DEFAULT_BORDER_COLOR="0xFFFFA500"
|
||||
|
||||
hyprctl dispatch fakefullscreen ""
|
||||
|
||||
fullscreen_status="$(hyprctl activewindow -j | jq '.fakeFullscreen')"
|
||||
if [ "$fullscreen_status" = "null" ]; then
|
||||
echo "Update your hyprland, 'fakeFullscreen' window property not found."
|
||||
exit 1
|
||||
elif [ "$fullscreen_status" = "true" ]; then
|
||||
window_address="$(hyprctl activewindow -j | jq -r '.address')"
|
||||
hyprctl setprop "address:$window_address" activebordercolor "$ACTIVE_BORDER_COLOR" lock
|
||||
elif [ "$fullscreen_status" = "false" ]; then
|
||||
window_address="$(hyprctl activewindow -j | jq -r '.address')"
|
||||
hyprctl setprop "address:$window_address" activebordercolor "$DEFAULT_BORDER_COLOR"
|
||||
else
|
||||
echo "Unexpected output from 'fakeFullscreen' window property: $fullscreen_status"
|
||||
exit 1
|
||||
fi
|
Loading…
Reference in a new issue