nixcfg/homeManagerModules/desktop/wayland/helpers.nix
Aly Raffauf 3663469066
sway,hyprland: convert startup apps to systemd (#73)
* home: switch hyprland and sway to new swayidle systemd service

* home: add swayosd service

* home: move swayidle and swayosd to services

* home/services: add swayidle and swayosd services

* hyprland,sway: don't start swayosd

* user playerctld as systemd service

* home: run gammastep as service for redShift"

* cleanup

* home: set swayosd and swayidle as wanted by hyprland and sway

* nix fmt

* home/services/swayidle: fixed resume command

* home/swayidle: fix command syntax

* home: better systemd defaults for swayidle and swayosd

* home: convert mako to systemd service

* home: make wayland-ipewire-idle-inhibit a systemd service

* home/waybar: use as systemd service

* home: move waybar to services

* home/desktop: convert randomWallpaper to systemd service

* migrate home options
2024-08-02 17:58:08 -04:00

52 lines
1.4 KiB
Nix

{
config,
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 = pkgs.writeShellScript "screenshooter" ''
FILENAME=${config.xdg.userDirs.pictures}/screenshots/$(date +'%Y-%m-%d-%H:%M:%S_grim.png')
MAKO_MODE=$(${lib.getExe' pkgs.mako "makoctl"} mode)
if echo "$MAKO_MODE" | grep -q "do-not-disturb"; then
DND=true
else
DND=false
${lib.getExe' pkgs.mako "makoctl"} mode -t do-not-disturb
fi
${lib.getExe pkgs.grim} -g "$(${lib.getExe pkgs.slurp} -o)" "$FILENAME"
if [ "$DND" = false ]; then
${lib.getExe' pkgs.mako "makoctl"} mode -t do-not-disturb
fi
if [ -e "$FILENAME" ]; then
${lib.getExe' pkgs.wl-clipboard-rs "wl-copy"} -t image/png < $FILENAME
${lib.getExe' pkgs.libnotify "notify-send"} "Screenshot saved" "$FILENAME" -i "$FILENAME"
fi
'';
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";
};
}