reorg and switc hto grim+slurp for screenshots
Some checks are pending
flakehub / flakehub-publish (push) Waiting to run
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:
Aly Raffauf 2024-07-21 20:59:03 -04:00
parent 2700c8af53
commit 1e1a02a5b3
5 changed files with 67 additions and 50 deletions

View file

@ -8,7 +8,7 @@
./gnome
./hyprland
./sway
./waylandComp.nix
./wayland
];
config =

View file

@ -6,36 +6,7 @@
}: let
cfg = config.ar.home;
scripts = import ./scripts.nix {inherit config lib pkgs;};
# Media/hardware commands
brightness = rec {
bin = lib.getExe' pkgs.swayosd "swayosd-client";
up = "${bin} --brightness=raise";
down = "${bin} --brightness=lower";
};
media = rec {
bin = lib.getExe pkgs.playerctl;
play = "${bin} play-pause";
paus = "${bin} pause";
next = "${bin} next";
prev = "${bin} previous";
};
screenshot = rec {
bin = lib.getExe pkgs.hyprshot;
folder = "${config.xdg.userDirs.pictures}/screenshots";
screen = "${bin} -m output -o ${folder}";
region = "${bin} -m region -o ${folder}";
};
volume = rec {
bin = lib.getExe' pkgs.swayosd "swayosd-client";
up = "${bin} --output-volume=raise";
down = "${bin} --output-volume=lower";
mute = "${bin} --output-volume=mute-toggle";
micMute = "${bin} --input-volume=mute-toggle";
};
helpers = import ../wayland/helpers.nix {inherit config lib pkgs;};
in {
"$mod" = "SUPER";
@ -56,7 +27,7 @@ in {
bind =
[
"$mod CONTROL,F12,exec,${screenshot.region}"
"$mod CONTROL,F12,exec,${helpers.screenshot.region}"
"$mod CONTROL,L,exec,${lib.getExe pkgs.swaylock}"
"$mod SHIFT,S,movetoworkspace,special:magic"
"$mod SHIFT,V,togglefloating"
@ -70,7 +41,7 @@ in {
"$mod,F,exec,${lib.getExe cfg.defaultApps.fileManager}"
"$mod,F11,exec,pkill -SIGUSR1 waybar"
"$mod,M,exec,${lib.getExe pkgs.wlogout}"
"$mod,PRINT,exec,${screenshot.region}"
"$mod,PRINT,exec,${helpers.screenshot.region}"
"$mod,R,exec,${lib.getExe pkgs.fuzzel}"
"$mod,S,togglespecialworkspace,magic"
"$mod,T,exec,${lib.getExe cfg.defaultApps.terminal}"
@ -78,8 +49,8 @@ in {
"$mod,mouse_down,workspace,+1"
"$mod,mouse_up,workspace,-1"
"$mod,period,exec,${lib.getExe pkgs.hyprnome}"
",PRINT,exec,${screenshot.screen}"
"CONTROL,F12,exec,${screenshot.screen}"
",PRINT,exec,${helpers.screenshot.screen}"
"CONTROL,F12,exec,${helpers.screenshot.screen}"
"CTRL ALT,M,submap,move"
"CTRL ALT,R,submap,resize"
]
@ -98,11 +69,11 @@ in {
bindl =
[
# Volume, microphone, and media keys.
",xf86audiomute,exec,${volume.mute}"
",xf86audiomicmute,exec,${volume.micMute}"
",xf86audioplay,exec,${media.play}"
",xf86audioprev,exec,${media.prev}"
",xf86audionext,exec,${media.next}"
",xf86audiomute,exec,${helpers.volume.mute}"
",xf86audiomicmute,exec,${helpers.volume.micMute}"
",xf86audioplay,exec,${helpers.media.play}"
",xf86audioprev,exec,${helpers.media.prev}"
",xf86audionext,exec,${helpers.media.next}"
]
++ builtins.map (switch: ",switch:${switch},exec,${scripts.tablet}") cfg.desktop.hyprland.tabletMode.tabletSwitches
++ lib.lists.optionals (cfg.desktop.hyprland.laptopMonitors != [])
@ -113,10 +84,10 @@ in {
bindle = [
# Display, volume, microphone, and media keys.
",xf86monbrightnessup,exec,${brightness.up}"
",xf86monbrightnessdown,exec,${brightness.down}"
",xf86audioraisevolume,exec,${volume.up}"
",xf86audiolowervolume,exec,${volume.down}"
",xf86monbrightnessup,exec,${helpers.brightness.up}"
",xf86monbrightnessdown,exec,${helpers.brightness.down}"
",xf86audioraisevolume,exec,${helpers.volume.up}"
",xf86audiolowervolume,exec,${helpers.volume.down}"
];
decoration = {

View file

@ -11,12 +11,13 @@
if config.wayland.windowManager.sway.package == pkgs.sway
then true
else false;
wayland = {
windowManager.sway.enable = true;
windowManager.sway.wrapperFeatures.gtk = true;
windowManager.sway.checkConfig = false;
windowManager.sway.config = let
wayland.windowManager.sway = {
enable = true;
wrapperFeatures.gtk = true;
checkConfig = false;
config = let
modifier = "Mod4";
swaymsg = lib.getExe' config.wayland.windowManager.sway.package "swaymsg";
@ -369,7 +370,7 @@
workspaceAutoBackAndForth = true;
};
windowManager.sway.extraConfig = let
extraConfig = let
brightness = lib.getExe' pkgs.swayosd "swayosd-client";
brightness_up = "${brightness} --brightness=raise";
brightness_down = "${brightness} --brightness=lower";

View file

@ -0,0 +1,45 @@
{
lib,
pkgs,
...
}: {
brightness = rec {
bin = lib.getExe' pkgs.swayosd "swayosd-client";
up = "${bin} --brightness=raise";
down = "${bin} --brightness=lower";
};
media = rec {
bin = lib.getExe pkgs.playerctl;
play = "${bin} play-pause";
paus = "${bin} pause";
next = "${bin} next";
prev = "${bin} previous";
};
screenshot = {
region = pkgs.writeShellScript "screenshot-region" ''
FILENAME=$HOME/pics/screenshots/$(date +'%Y-%m-%d-%H:%M_grim.png')
${lib.getExe pkgs.grim} -g "$(${lib.getExe pkgs.slurp})" "$FILENAME"
${lib.getExe' pkgs.wl-clipboard-rs "wl-copy"} $FILENAME
${lib.getExe' pkgs.libnotify "notify-send"} "Screenshot saved" "$FILENAME" -i "$FILENAME"
'';
screen = pkgs.writeShellScript "screenshot-screen" ''
FILENAME=$HOME/pics/screenshots/$(date +'%Y-%m-%d-%H:%M_grim.png')
${lib.getExe pkgs.grim} -g "$(${lib.getExe pkgs.slurp} -o)" "$FILENAME"
${lib.getExe' pkgs.wl-clipboard-rs "wl-copy"} $FILENAME
${lib.getExe' pkgs.libnotify "notify-send"} "Screenshot saved" "$FILENAME" -i "$FILENAME"
'';
};
volume = rec {
bin = lib.getExe' pkgs.swayosd "swayosd-client";
up = "${bin} --output-volume=raise";
down = "${bin} --output-volume=lower";
mute = "${bin} --output-volume=mute-toggle";
micMute = "${bin} --input-volume=mute-toggle";
};
}