mirror of
https://github.com/alyraffauf/nixcfg.git
synced 2024-11-21 18:33:55 -05:00
sway: add improved clamshell script and binds
Some checks are pending
git-mirror / gitlab-sync (push) Waiting to run
nix-build / default-build (push) Waiting to run
nix-build / fallarbor-build (push) Waiting to run
nix-build / lavaridge-build (push) Waiting to run
nix-build / mauville-build (push) Waiting to run
nix-build / petalburg-build (push) Waiting to run
nix-build / rustboro-build (push) Waiting to run
nix-check / fmt-check (push) Waiting to run
nix-check / eval-check (push) Waiting to run
Some checks are pending
git-mirror / gitlab-sync (push) Waiting to run
nix-build / default-build (push) Waiting to run
nix-build / fallarbor-build (push) Waiting to run
nix-build / lavaridge-build (push) Waiting to run
nix-build / mauville-build (push) Waiting to run
nix-build / petalburg-build (push) Waiting to run
nix-build / rustboro-build (push) Waiting to run
nix-check / fmt-check (push) Waiting to run
nix-check / eval-check (push) Waiting to run
This commit is contained in:
parent
c0597a357a
commit
8dd1e5c113
21
homeManagerModules/desktop/sway/scripts.nix
Normal file
21
homeManagerModules/desktop/sway/scripts.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
swaymsg = lib.getExe' config.wayland.windowManager.sway.package "swaymsg";
|
||||
in {
|
||||
clamshell = pkgs.writeShellScript "sway-clamshell" ''
|
||||
docked() {
|
||||
[ "$(${swaymsg} -t get_outputs | ${lib.getExe pkgs.jq} '. | length')" -ne 1 ] && return 0
|
||||
return 1
|
||||
}
|
||||
|
||||
if [ "$1" == "on" ]; then
|
||||
docked && swaymsg output eDP-1 disable
|
||||
elif [ "$1" == "off" ]; then
|
||||
swaymsg output eDP-1 enable
|
||||
fi
|
||||
'';
|
||||
}
|
|
@ -7,6 +7,7 @@
|
|||
cfg = config.ar.home;
|
||||
helpers = import ../wayland/helpers.nix {inherit config lib pkgs;};
|
||||
modifier = "Mod4";
|
||||
scripts = import ./scripts.nix {inherit config lib pkgs;};
|
||||
in {
|
||||
enable = true;
|
||||
checkConfig = false;
|
||||
|
@ -269,8 +270,8 @@ in {
|
|||
bindgesture swipe:right workspace prev
|
||||
bindgesture swipe:left workspace next
|
||||
|
||||
bindswitch --reload --locked lid:on output eDP-1 disable
|
||||
bindswitch --reload --locked lid:off output eDP-1 enable
|
||||
bindswitch --reload --locked lid:on exec ${scripts.clamshell} on
|
||||
bindswitch --reload --locked lid:off exec ${scripts.clamshell} off
|
||||
|
||||
default_border pixel 4
|
||||
default_floating_border pixel 4
|
||||
|
|
Loading…
Reference in a new issue