Skip to content

Commit

Permalink
fix: hyprland pkg exe references
Browse files Browse the repository at this point in the history
  • Loading branch information
khaneliman committed Oct 29, 2023
1 parent e5dae85 commit 0cdaef5
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 40 deletions.
6 changes: 3 additions & 3 deletions modules/home/desktop/hyprland/apps.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
, ...
}:
let
inherit (lib) mkIf getExe;
inherit (lib) mkIf getExe getExe';

cfg = config.khanelinix.desktop.hyprland;

Expand Down Expand Up @@ -44,8 +44,8 @@ in
"${getExe pkgs.ckb-next} -b"
"${getExe pkgs.openrgb} --startminimized --profile default"
"${getExe pkgs._1password-gui-beta} --silent"
"command -v ${getExe pkgs.cliphist} && wl-paste --type text --watch cliphist store" #Stores only text data
"command -v ${getExe pkgs.cliphist} && wl-paste --type image --watch cliphist store" #Stores only image data
"command -v ${getExe pkgs.cliphist} && ${getExe' pkgs.wl-clipboard "wl-paste"} --type text --watch cliphist store" #Stores only text data
"command -v ${getExe pkgs.cliphist} && ${getExe' pkgs.wl-clipboard "wl-paste"} --type image --watch cliphist store" #Stores only image data

# Startup apps that have rules for organizing them
"${getExe pkgs.firefox}"
Expand Down
46 changes: 26 additions & 20 deletions modules/home/desktop/hyprland/binds.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
{ config
, inputs
, lib
, pkgs
, system
, ...
}:
let
inherit (lib) mkIf getExe;
inherit (lib) mkIf getExe getExe';
inherit (inputs) hyprland-contrib;

cfg = config.khanelinix.desktop.hyprland;
in
{
Expand All @@ -21,7 +26,7 @@ in
"SUPER_ALT, RETURN, exec, $term tmux"
"SUPER_SHIFT, RETURN, exec, $term --title floating_kitty --single-instance"
"$mainMod, Q, killactive,"
"SUPER_SHIFT, P, exec, hyprpicker -a && (convert -size 32x32 xc:$(wl-paste) /tmp/color.png && notify-send \"Color Code:\" \"$(wl-paste)\" -h \"string:bgcolor:$(wl-paste)\" --icon /tmp/color.png -u critical -t 4000)"
"SUPER_SHIFT, P, exec, ${getExe pkgs.hyprpicker} -a && (${getExe' pkgs.imagemagick "convert"} -size 32x32 xc:$(${getExe' pkgs.wl-clipboard "wl-paste"}) /tmp/color.png && ${getExe pkgs.libnotify} \"Color Code:\" \"$(${getExe' pkgs.wl-clipboard "wl-paste"})\" -h \"string:bgcolor:$(${getExe' pkgs.wl-clipboard "wl-paste"})\" --icon /tmp/color.png -u critical -t 4000)"
"$mainMod, B, exec, $browser"
"$mainMod, E, exec, $term ranger"
"SUPER_SHIFT, E, exec, $explorer"
Expand All @@ -30,10 +35,11 @@ in
"$mainMod, A, exec, $launchpad"
"$mainMod, L, exec, ${getExe config.programs.swaylock.package} --grace 0 --fade-in 0"
"$mainMod, T, exec, $term btop"
"$mainMod, N, exec, swaync-client -t -sw"
"$mainMod, N, exec, ${getExe' pkgs.swaynotificationcenter "swaync-client"} -t -sw"
# "SUPER, V, clipman pick -t rofi
"$mainMod, V, exec, cliphist list | rofi -dmenu | cliphist decode | wl-copy"
"$mainMod, V, exec, ${getExe pkgs.cliphist} list | ${getExe config.programs.rofi.package} -dmenu | ${getExe pkgs.cliphist} decode | ${getExe' pkgs.wl-clipboard "wl-copy"}"
"$mainMod, W, exec, $looking-glass"
"$mainMod, I, exec, ${getExe hyprland-contrib.packages.${system}.hyprprop}"

# ░█▀▀░█░█░█▀▀░▀█▀░█▀▀░█▄█
# ░▀▀█░░█░░▀▀█░░█░░█▀▀░█░█
Expand All @@ -42,23 +48,23 @@ in
"$LHYPER, L, exit, "
# "$RHYPER, R, exec, reboot" # TODO: fix
# "$RHYPER, P, exec, shutdown" # TODO: fix
"$LHYPER, T, exec, notify-send 'test left'"
"$RHYPER, T, exec, notify-send 'test right'"
"$LHYPER, T, exec, ${getExe pkgs.libnotify} 'test left'"
"$RHYPER, T, exec, ${getExe pkgs.libnotify} 'test right'"

# ░█▀▀░█▀▀░█▀▄░█▀▀░█▀▀░█▀█░█▀▀░█░█░█▀█░▀█▀
# ░▀▀█░█░░░█▀▄░█▀▀░█▀▀░█░█░▀▀█░█▀█░█░█░░█░
# ░▀▀▀░▀▀▀░▀░▀░▀▀▀░▀▀▀░▀░▀░▀▀▀░▀░▀░▀▀▀░░▀░
# Pictures
", Print, exec, file=\"$(xdg-user-dir PICTURES)/screenshots/$(date +'%Y%m%d_%H%M%S.png')\" && grim \"$file\" && notify-send --icon \"$file\" 'Screenshot Saved'"
"SHIFT, Print, exec, file=\"$(xdg-user-dir PICTURES)/screenshots/$(date +'%Y%m%d_%H%M%S.png')\" && grim -g \"$(slurp)\" \"$file\" && notify-send --icon \"$file\" 'Screenshot Saved'"
"SUPER_SHIFT, Print, exec, grim -g \"$(slurp)\" - | swappy -f -"
"SUPER, Print, exec, grim - | swappy -f -"
"CONTROL, Print, exec, grimblast copy screen && wl-paste -t image/png | convert png:- /tmp/clipboard.png && notify-send --icon=/tmp/clipboard.png 'Screen copied to clipboard'"
"SUPER_CTRL, Print, exec, grimblast copy active && wl-paste -t image/png | convert png:- /tmp/clipboard.png && notify-send --icon=/tmp/clipboard.png 'Window copied to clipboard'"
"SUPER_CTRL_SHIFT, Print, exec, grimblast copy area && wl-paste -t image/png | convert png:- /tmp/clipboard.png && notify-send --icon=/tmp/clipboard.png 'Area copied to clipboard'"
", Print, exec, file=\"$(xdg-user-dir PICTURES)/screenshots/$(date +'%Y%m%d_%H%M%S.png')\" && ${getExe pkgs.grim} \"$file\" && ${getExe pkgs.libnotify} --icon \"$file\" 'Screenshot Saved'"
"SHIFT, Print, exec, file=\"$(xdg-user-dir PICTURES)/screenshots/$(date +'%Y%m%d_%H%M%S.png')\" && ${getExe pkgs.grim} -g \"$(slurp)\" \"$file\" && ${getExe pkgs.libnotify} --icon \"$file\" 'Screenshot Saved'"
"SUPER_SHIFT, Print, exec, ${getExe pkgs.grim} -g \"$(${getExe pkgs.slurp})\" - | ${getExe pkgs.swappy} -f -"
"SUPER, Print, exec, ${getExe pkgs.grim} - | ${getExe pkgs.swappy} -f -"
"CONTROL, Print, exec, ${getExe pkgs.grimblast} copy screen && ${getExe' pkgs.wl-clipboard "wl-paste"} -t image/png | ${getExe' pkgs.imagemagick "convert"} png:- /tmp/clipboard.png && ${getExe pkgs.libnotify} --icon=/tmp/clipboard.png 'Screen copied to clipboard'"
"SUPER_CTRL, Print, exec, ${getExe pkgs.grimblast} copy active && ${getExe' pkgs.wl-clipboard "wl-paste"} -t image/png | ${getExe' pkgs.imagemagick "convert"} png:- /tmp/clipboard.png && ${getExe pkgs.libnotify} --icon=/tmp/clipboard.png 'Window copied to clipboard'"
"SUPER_CTRL_SHIFT, Print, exec, ${getExe pkgs.grimblast} copy area && ${getExe' pkgs.wl-clipboard "wl-paste"} -t image/png | ${getExe' pkgs.imagemagick "convert"} png:- /tmp/clipboard.png && ${getExe pkgs.libnotify} --icon=/tmp/clipboard.png 'Area copied to clipboard'"
# Screen recording
"SUPER_CTRLALT, Print, exec, record_screen screen"
"SUPER_CTRLALTSHIFT, Print, exec, record_screen area"
"SUPER_CTRLALT, Print, exec, ${getExe pkgs.khanelinix.record_screen} screen"
"SUPER_CTRLALTSHIFT, Print, exec, ${getExe pkgs.khanelinix.record_screen} area"

# ░█░░░█▀█░█░█░█▀█░█░█░▀█▀
# ░█░░░█▀█░░█░░█░█░█░█░░█░
Expand Down Expand Up @@ -133,11 +139,11 @@ in
",XF86AudioMute,exec,wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
",XF86MonBrightnessUp,exec,light -A 5"
",XF86MonBrightnessDown,exec,light -U 5"
",XF86AudioMedia,exec,playerctl play-pause"
",XF86AudioPlay,exec,playerctl play-pause"
",XF86AudioStop,exec,playerctl stop"
",XF86AudioPrev,exec,playerctl previous"
",XF86AudioNext,exec,playerctl next"
",XF86AudioMedia,exec,${getExe pkgs.playerctl} play-pause"
",XF86AudioPlay,exec,${getExe pkgs.playerctl} play-pause"
",XF86AudioStop,exec,${getExe pkgs.playerctl} stop"
",XF86AudioPrev,exec,${getExe pkgs.playerctl} previous"
",XF86AudioNext,exec,${getExe pkgs.playerctl} next"
]
# ░█░█░█▀█░█▀▄░█░█░█▀▀░█▀█░█▀█░█▀▀░█▀▀
# ░█▄█░█░█░█▀▄░█▀▄░▀▀█░█▀▀░█▀█░█░░░█▀▀
Expand Down
4 changes: 2 additions & 2 deletions modules/home/desktop/hyprland/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
, ...
}:
let
inherit (lib) mkIf mkEnableOption;
inherit (lib) mkIf mkEnableOption getExe;
inherit (lib.internal) enabled;
inherit (inputs) hyprland;

Expand Down Expand Up @@ -82,7 +82,7 @@ in

settings = {
exec = [
"notify-send --icon ~/.face -u normal \"Hello $(whoami)\""
"${getExe pkgs.libnotify} --icon ~/.face -u normal \"Hello $(whoami)\""
];
};

Expand Down
6 changes: 3 additions & 3 deletions modules/home/desktop/hyprland/variables.nix
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ in
"$editor" = "${getExe pkgs.neovim}";
"$explorer" = "${getExe pkgs.xfce.thunar}";
"$music" = "${getExe pkgs.spotify}";
"$launcher" = "${getExe pkgs.rofi} -show drun -n";
"$launcher_alt" = "${getExe pkgs.rofi} -show run -n";
"$launchpad" = "${getExe pkgs.rofi} -show drun -config '~/.config/rofi/appmenu/rofi.rasi'";
"$launcher" = "${getExe config.programs.rofi.package} -show drun -n";
"$launcher_alt" = "${getExe config.programs.rofi.package} -show run -n";
"$launchpad" = "${getExe config.programs.rofi.package} -show drun -config '~/.config/rofi/appmenu/rofi.rasi'";
"$looking-glass" = "${getExe pkgs.looking-glass-client}";
};
};
Expand Down
13 changes: 5 additions & 8 deletions modules/nixos/desktop/hyprland/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
, ...
}:
let
inherit (lib) types mkIf getExe';
inherit (lib) types mkIf getExe getExe';
inherit (lib.internal) mkBoolOpt mkOpt enabled;
inherit (inputs) hyprland-contrib hyprland;

Expand Down Expand Up @@ -46,27 +46,24 @@ in

environment.systemPackages = with pkgs; [
hyprpaper
hyprpicker
hyprland-contrib.packages.${hostPlatform.system}.grimblast
khanelinix.record_screen
];

khanelinix = {
apps = {
partitionmanager = enabled;
gamemode = {
startscript = ''
${getExe' pkgs.libnotify "notify-send"} 'GameMode started'
${getExe pkgs.libnotify} 'GameMode started'
export PATH=$PATH:${programs}
export HYPRLAND_INSTANCE_SIGNATURE=$(ls -1 /tmp/hypr | tail -1)
hyprctl --batch 'keyword decoration:blur 0 ; keyword animations:enabled 0 ; keyword misc:no_vfr 1'
${getExe' hyprland.packages.${system}.hyprland "hyprctl"} --batch 'keyword decoration:blur 0 ; keyword animations:enabled 0 ; keyword misc:no_vfr 1'
'';

endscript = ''
${getExe' pkgs.libnotify "notify-send"} 'GameMode stopped'
${getExe pkgs.libnotify} 'GameMode stopped'
export PATH=$PATH:${programs}
export HYPRLAND_INSTANCE_SIGNATURE=$(ls -1 /tmp/hypr | tail -1)
hyprctl --batch 'keyword decoration:blur 1 ; keyword animations:enabled 1 ; keyword misc:no_vfr 0'
${getExe' hyprland.packages.${system}.hyprland "hyprctl"} --batch 'keyword decoration:blur 1 ; keyword animations:enabled 1 ; keyword misc:no_vfr 0'
'';
};
};
Expand Down
4 changes: 0 additions & 4 deletions modules/nixos/suites/wlroots/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,9 @@ in

config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
cliphist
grim
slurp
swayimg
wdisplays
wf-recorder
wl-clipboard
wlr-randr
# Not really wayland specific, but I don't want to make a new module for it
brightnessctl
Expand Down

0 comments on commit 0cdaef5

Please sign in to comment.