This commit is contained in:
2026-02-25 15:07:46 +01:00
62 changed files with 76 additions and 4178 deletions

View File

@@ -6,7 +6,22 @@
pkgs,
...
}:
let
exe = pkg: bin: if isNixOS then "${pkg}/bin/${bin}" else "/usr/bin/${bin}";
jq = exe pkgs.jq "jq";
grim = exe pkgs.grim "grim";
satty = exe pkgs.satty "satty";
wl_copy = exe pkgs.wl-clipboard "wl-copy";
notify_send = exe pkgs.libnotify "notify-send";
xdg-desktop-portal-hyprland =
if isNixOS then
"${pkgs.xdg-desktop-portal-hyprland}/libexec/xdg-desktop-portal-hyprland"
else
"/usr/lib/xdg-desktop-portal-hyprland";
hyprlock = exe pkgs.hyprlock "hyprlock";
playerctl = exe pkgs.playerctl "playerctl";
in
{
wayland.windowManager.hyprland = {
enable = true;
@@ -108,9 +123,9 @@
};
permission = [
".*(grim), screencopy, allow"
".*(hyprlock), screencopy, allow"
".*(xdg-desktop-portal-hyprland), screencopy, allow"
"^${grim}$, screencopy, allow"
"^${hyprlock}$, screencopy, allow"
"^${xdg-desktop-portal-hyprland}$, screencopy, allow"
];
input = {
@@ -294,19 +309,36 @@
", XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_SOURCE@ toggle"
];
bindl = [
", XF86AudioMute, exec, wpctl set-mute @DEFAULT_SINK@ toggle && ~/.local/bin/check-if-muted.sh"
", XF86AudioNext, exec, playerctl next"
", Pause, exec, playerctl play-pause"
"$mainMod, Pause, exec, playerctl play-pause --player spotify"
", XF86AudioPlay, exec, playerctl play-pause"
", XF86AudioPrev, exec, playerctl previous"
];
bindt = [
", PRINT, exec, ~/.local/bin/screenshot.sh region"
"$mainMod, PRINT, exec, ~/.local/bin/screenshot.sh fullscreen"
"alt_l, PRINT, exec, ~/.local/bin/screenshot.sh window"
", PRINT, exec, ${pkgs.writeShellScript "screenshot-region" ''
MONITOR=$(hyprctl monitors -j | ${jq} -r '.[] | select(.focused == true) | .name')
${grim} -o "$MONITOR" - | ${satty} -f -
''}"
"$mainMod, PRINT, exec, ${pkgs.writeShellScript "screenshot-fullscreen" ''
target_path="$HOME/${userConfig.pathConfig.screenshot}/$(date +'%d-%m-%Y_%H-%M-%S').png"
mkdir -p "$(dirname "$target_path")"
MONITOR=$(hyprctl monitors -j | ${jq} -r '.[] | select(.focused == true) | .name')
${grim} -o "$MONITOR" "$target_path"
${wl_copy} < "$target_path"
${notify_send} -i "$target_path" -u low -a "Screenshot" "Screenshot fullscreen" "Saved and copied"
''}"
"alt_l, PRINT, exec, ${pkgs.writeShellScript "screenshot-window" ''
target_path="$HOME/${userConfig.pathConfig.screenshot}/$(date +'%d-%m-%Y_%H-%M-%S').png"
mkdir -p "$(dirname "$target_path")"
GEOMETRY=$(hyprctl activewindow -j | ${jq} -r '"\(.at[0]),\(.at[1]) \(.size[0])x\(.size[1])"')
${grim} -g "$GEOMETRY" "$target_path"
${wl_copy} < "$target_path"
${notify_send} -i "$target_path" -u low -a "Screenshot" "Screenshot window" "Saved and copied"
''}"
", PAUSE, exec, ${playerctl} play-pause"
"$mainMod, PAUSE, exec, ${playerctl} play-pause --player spotify"
];
bindm = [