rewrite home modules to dynamically get executables iwth lib.getExe and lib.getExe'

This commit is contained in:
Aly Raffauf 2024-05-05 19:39:36 -04:00
parent 9625af21f5
commit 5634e4e8a3
8 changed files with 147 additions and 83 deletions

View file

@ -23,8 +23,8 @@
"files.autoSave" = "afterDelay"; "files.autoSave" = "afterDelay";
"git.autofetch" = true; "git.autofetch" = true;
"git.confirmSync" = false; "git.confirmSync" = false;
"nix.formatterPath" = "${pkgs.alejandra}/bin/alejandra"; "nix.formatterPath" = lib.getExe pkgs.alejandra;
"terminal.external.linuxExec" = "${pkgs.alacritty}/bin/alacritty"; "terminal.external.linuxExec" = lib.getExe pkgs.alacritty;
"update.mode" = "none"; "update.mode" = "none";
"window.menuBarVisibility" = "hidden"; "window.menuBarVisibility" = "hidden";
"window.zoomPerWindow" = false; "window.zoomPerWindow" = false;

View file

@ -128,7 +128,7 @@
"sort-by" = "id"; "sort-by" = "id";
}; };
"hyprland/submap" = { "hyprland/submap" = {
"on-click" = "${config.wayland.windowManager.hyprland.package}/bin/hyprctl dispatch submap reset"; "on-click" = ''${lib.getExe' config.wayland.windowManager.hyprland.package "hyprctl"} dispatch submap reset'';
}; };
"hyprland/window" = { "hyprland/window" = {
"format" = ""; "format" = "";
@ -146,7 +146,7 @@
"sort-by" = "id"; "sort-by" = "id";
}; };
"sway/mode" = { "sway/mode" = {
"on-click" = "${config.wayland.windowManager.sway.package}/bin/swaymsg mode default"; "on-click" = ''${lib.getExe' config.wayland.windowManager.sway.package "swaymsg"} mode default'';
}; };
"sway/window" = { "sway/window" = {
"max-length" = 100; "max-length" = 100;
@ -188,7 +188,7 @@
{device_enumerate}''; {device_enumerate}'';
"tooltip-format-enumerate-connected" = "{device_alias} {device_address}"; "tooltip-format-enumerate-connected" = "{device_alias} {device_address}";
"on-click" = "${pkgs.blueberry}/bin/blueberry"; "on-click" = lib.getExe' pkgs.blueberry "blueberry";
}; };
"pulseaudio" = { "pulseaudio" = {
"format" = "{icon}"; "format" = "{icon}";
@ -202,7 +202,7 @@
}; };
"scroll-step" = 5; "scroll-step" = 5;
"ignored-sinks" = ["Easy Effects Sink"]; "ignored-sinks" = ["Easy Effects Sink"];
"on-click" = "${pkgs.pavucontrol}/bin/pavucontrol -t 3"; "on-click" = "${lib.getExe pkgs.pavucontrol} -t 3";
}; };
"network" = { "network" = {
"format-wifi" = "{icon}"; "format-wifi" = "{icon}";
@ -213,11 +213,11 @@
"tooltip-format-wifi" = "{essid} ({signalStrength}%) {icon}"; "tooltip-format-wifi" = "{essid} ({signalStrength}%) {icon}";
"tooltip-format-ethernet" = "{ifname} "; "tooltip-format-ethernet" = "{ifname} ";
"tooltip-format-disconnected" = "Disconnected"; "tooltip-format-disconnected" = "Disconnected";
"on-click" = "${pkgs.alacritty}/bin/alacritty --class nmtui -e ${pkgs.networkmanager}/bin/nmtui"; "on-click" = "${lib.getExe pkgs.alacritty} --class nmtui -e ${pkgs.networkmanager}/bin/nmtui";
}; };
"tray" = {"spacing" = 15;}; "tray" = {"spacing" = 15;};
"custom/logout" = { "custom/logout" = {
"on-click" = "${pkgs.wlogout}/bin/wlogout"; "on-click" = "${lib.getExe pkgs.wlogout}";
"format" = "󰗽"; "format" = "󰗽";
}; };
"power-profiles-daemon" = { "power-profiles-daemon" = {

View file

@ -12,19 +12,19 @@
layout = [ layout = [
{ {
label = "logout"; label = "logout";
action = "${pkgs.systemd}/bin/loginctl terminate-user ${config.home.username}"; action = ''${lib.getExe' pkgs.systemd "loginctl"} terminate-user ${config.home.username}'';
text = "Logout"; text = "Logout";
keybind = "e"; keybind = "e";
} }
{ {
label = "shutdown"; label = "shutdown";
action = "${pkgs.systemd}/bin/systemctl poweroff"; action = ''${lib.getExe' pkgs.systemd "systemctl"} poweroff'';
text = "Shutdown"; text = "Shutdown";
keybind = "s"; keybind = "s";
} }
{ {
label = "reboot"; label = "reboot";
action = "${pkgs.systemd}/bin/systemctl reboot"; action = ''${lib.getExe' pkgs.systemd "systemctl"} reboot'';
text = "Reboot"; text = "Reboot";
keybind = "r"; keybind = "r";
} }

View file

@ -0,0 +1,64 @@
{
pkgs,
lib,
config,
...
}: {
options = {
alyraffauf.desktop.defaultApps.enable =
lib.mkEnableOption "GTK and Qt themes.";
alyraffauf.desktop.defaultApps.browser = {
name = lib.mkOption {
description = "Default web browser executable name.";
default = "firefox";
type = lib.types.str;
};
desktop = lib.mkOption {
description = "Default web browser desktop file name.";
default = "firefox.desktop";
type = lib.types.str;
};
package = lib.mkOption {
description = "Default web browser package.";
default = pkgs.firefox;
type = lib.types.package;
};
};
alyraffauf.desktop.defaultApps.editor = {
name = lib.mkOption {
description = "Default editor executable name.";
default = "codium";
type = lib.types.str;
};
desktop = lib.mkOption {
description = "Default editor desktop file name.";
default = "codium.desktop";
type = lib.types.str;
};
package = lib.mkOption {
description = "Default editor package.";
default = pkgs.vsCodium;
type = lib.types.package;
};
};
};
config = lib.mkIf config.alyraffauf.desktop.theme.enable {
xdg.mimeApps = {
enable = true;
defaultApplications = {
"application/xhtml+xml" = "firefox.desktop";
"text/html" = "firefox.desktop";
"text/xml" = "firefox.desktop";
"x-scheme-handler/ftp" = "firefox.desktop";
"x-scheme-handler/http" = "firefox.desktop";
"x-scheme-handler/https" = "firefox.desktop";
};
};
home.sessionVariables = {
EDITOR = "${lib.getExe pkgs.neovim}";
BROWSER = "${lib.getExe pkgs.firefox}";
TERMINAL = "${lib.getExe pkgs.kitty}";
};
};
}

View file

@ -63,13 +63,13 @@
modifier = "SUPER"; modifier = "SUPER";
# Default apps # Default apps
browser = pkgs.firefox + "/bin/firefox"; browser = lib.getExe pkgs.firefox;
fileManager = pkgs.xfce.thunar + "/bin/thunar"; fileManager = lib.getExe pkgs.xfce.thunar;
editor = pkgs.vscodium + "/bin/codium"; editor = lib.getExe pkgs.vscodium;
terminal = pkgs.alacritty + "/bin/alacritty"; terminal = lib.getExe pkgs.alacritty;
# Media/hardware commands # Media/hardware commands
# brightness = "${pkgs.brightnessctl}/bin/brightnessctl"; # brightness = "${lib.getExe pkgs.brightnessctl}";
# brightness_up = "${brightness} set 5%+"; # brightness_up = "${brightness} set 5%+";
# brightness_down = "${brightness} set 5%-"; # brightness_down = "${brightness} set 5%-";
# volume = "${pkgs.wireplumber}/bin/wpctl"; # volume = "${pkgs.wireplumber}/bin/wpctl";
@ -77,44 +77,44 @@
# volume_down = "${volume} set-volume -l 1.0 @DEFAULT_SINK@ 5%-"; # volume_down = "${volume} set-volume -l 1.0 @DEFAULT_SINK@ 5%-";
# volume_mute = "${volume} set-mute @DEFAULT_SINK@ toggle"; # volume_mute = "${volume} set-mute @DEFAULT_SINK@ toggle";
# mic_mute = "${volume} set-mute @DEFAULT_AUDIO_SOURCE@ toggle"; # mic_mute = "${volume} set-mute @DEFAULT_AUDIO_SOURCE@ toggle";
brightness = "${pkgs.swayosd}/bin/swayosd-client"; brightness = lib.getExe' pkgs.swayosd "swayosd-client";
brightness_up = "${brightness} --brightness=raise"; brightness_up = "${brightness} --brightness=raise";
brightness_down = "${brightness} --brightness=lower"; brightness_down = "${brightness} --brightness=lower";
volume = "${pkgs.swayosd}/bin/swayosd-client"; volume = brightness;
volume_up = "${volume} --output-volume=raise"; volume_up = "${volume} --output-volume=raise";
volume_down = "${volume} --output-volume=lower"; volume_down = "${volume} --output-volume=lower";
volume_mute = "${volume} --output-volume=mute-toggle"; volume_mute = "${volume} --output-volume=mute-toggle";
mic_mute = "${volume} --input-volume=mute-toggle"; mic_mute = "${volume} --input-volume=mute-toggle";
media = "${pkgs.playerctl}/bin/playerctl"; media = lib.getExe pkgs.playerctl;
media_play = "${media} play-pause"; media_play = "${media} play-pause";
media_next = "${media} next"; media_next = "${media} next";
media_prev = "${media} previous"; media_prev = "${media} previous";
# Hyprland desktop utilities # Hyprland desktop utilities
bar = pkgs.waybar + "/bin/waybar"; bar = lib.getExe pkgs.waybar;
launcher = pkgs.fuzzel + "/bin/fuzzel"; launcher = lib.getExe pkgs.fuzzel;
notifyd = pkgs.mako + "/bin/mako"; notifyd = lib.getExe pkgs.mako;
wallpaperd = pkgs.hyprpaper + "/bin/hyprpaper"; wallpaperd = lib.getExe pkgs.hyprpaper;
logout = pkgs.wlogout + "/bin/wlogout"; logout = lib.getExe pkgs.wlogout;
# lock = pkgs.hyprlock + "/bin/hyprlock --immediate"; # lock = pkgs.hyprlock + "/bin/hyprlock --immediate";
# idled = pkgs.hypridle + "/bin/hypridle"; # idled = pkgs.hypridle + "/bin/hypridle";
lock = pkgs.swaylock + ''/bin/swaylock''; lock = lib.getExe pkgs.swaylock;
idled = idled =
if config.alyraffauf.desktop.hyprland.autoSuspend if config.alyraffauf.desktop.hyprland.autoSuspend
then '' then ''
${pkgs.swayidle}/bin/swayidle -w timeout 240 '${pkgs.brightnessctl}/bin/brightnessctl -s set 10' resume '${pkgs.brightnessctl}/bin/brightnessctl -r' timeout 300 '${lock}' timeout 330 '${config.wayland.windowManager.hyprland.package}/bin/hyprctl dispatch dpms off' resume '${config.wayland.windowManager.hyprland.package}/bin/hyprctl dispatch dpms on' timeout 900 '${pkgs.systemd}/bin/systemctl suspend' before-sleep '${media} pause' before-sleep '${lock}' ${lib.getExe pkgs.swayidle} -w timeout 240 '${lib.getExe pkgs.brightnessctl} -s set 10' resume '${lib.getExe pkgs.brightnessctl} -r' timeout 300 '${lock}' timeout 330 '${lib.getExe' config.wayland.windowManager.hyprland.package "hyprctl"} dispatch dpms off' resume '${lib.getExe' config.wayland.windowManager.hyprland.package "hyprctl"} dispatch dpms on' timeout 900 '${lib.getExe' pkgs.systemd "systemctl"}' before-sleep '${media} pause' before-sleep '${lock}'
'' ''
else '' else ''
${pkgs.swayidle}/bin/swayidle -w timeout 240 '${pkgs.brightnessctl}/bin/brightnessctl -s set 10' resume '${pkgs.brightnessctl}/bin/brightnessctl -r' timeout 300 '${lock}' timeout 330 '${config.wayland.windowManager.hyprland.package}/bin/hyprctl dispatch dpms off' resume '${config.wayland.windowManager.hyprland.package}/bin/hyprctl dispatch dpms on' before-sleep '${media} pause' before-sleep '${lock}' ${lib.getExe pkgs.swayidle} -w timeout 240 '${lib.getExe pkgs.brightnessctl} -s set 10' resume '${lib.getExe pkgs.brightnessctl} -r' timeout 300 '${lock}' timeout 330 '${lib.getExe' config.wayland.windowManager.hyprland.package "hyprctl"} dispatch dpms off' resume '${lib.getExe' config.wayland.windowManager.hyprland.package "hyprctl"} dispatch dpms on' before-sleep '${media} pause' before-sleep '${lock}'
''; '';
hyprnome = pkgs.hyprnome + "/bin/hyprnome"; hyprnome = lib.getExe pkgs.hyprnome;
hyprshade = pkgs.hyprshade + "/bin/hyprshade"; hyprshade = lib.getExe pkgs.hyprshade;
screenshot = "${pkgs.hyprshot}/bin/hyprshot"; screenshot = lib.getExe pkgs.hyprshot;
screenshot_folder = "~/pics/screenshots"; screenshot_folder = "~/pics/screenshots";
screenshot_screen = "${screenshot} -m output -o ${screenshot_folder}"; screenshot_screen = "${screenshot} -m output -o ${screenshot_folder}";
screenshot_region = "${screenshot} -m region -o ${screenshot_folder}"; screenshot_region = "${screenshot} -m region -o ${screenshot_folder}";
@ -153,15 +153,15 @@
exec-once = ${wallpaperd} exec-once = ${wallpaperd}
exec-once = ${bar} exec-once = ${bar}
exec-once = ${notifyd} exec-once = ${notifyd}
exec-once = ${pkgs.wl-clipboard}/bin/wl-paste --type text --watch cliphist store exec-once = ${lib.getExe' pkgs.wl-clipboard "wl-paste"} --type image --watch ${lib.getExe pkgs.cliphist} store
exec-once = ${pkgs.wl-clipboard}/bin/wl-paste --type image --watch cliphist store exec-once = ${lib.getExe' pkgs.wl-clipboard "wl-paste"} --type text --watch ${lib.getExe pkgs.cliphist} store
exec-once = ${pkgs.mate.mate-polkit}/libexec/polkit-mate-authentication-agent-1 exec-once = ${pkgs.mate.mate-polkit}/libexec/polkit-mate-authentication-agent-1
exec-once = ${fileManager} --daemon exec-once = ${fileManager} --daemon
exec = ${pkgs.hyprshade}/bin/hyprshade auto exec = ${hyprshade} auto
exec-once = ${idled} exec-once = ${idled}
exec-once = ${pkgs.swayosd}/bin/swayosd-server exec-once = ${lib.getExe' pkgs.swayosd "swayosd-server"}
exec-once = ${pkgs.networkmanagerapplet}/bin/nm-applet exec-once = ${lib.getExe' pkgs.networkmanagerapplet "nm-applet"}
exec-once = ${pkgs.playerctl}/bin/playerctld exec-once = ${lib.getExe' pkgs.playerctl "playerctld"}
# For all categories, see https://wiki.hyprland.org/Configuring/Variables/ # For all categories, see https://wiki.hyprland.org/Configuring/Variables/
input { input {

View file

@ -49,56 +49,56 @@
modifier = "Mod4"; modifier = "Mod4";
# Default apps # Default apps
browser = pkgs.firefox + "/bin/firefox"; browser = lib.getExe pkgs.firefox;
fileManager = pkgs.xfce.thunar + "/bin/thunar"; fileManager = lib.getExe pkgs.xfce.thunar;
editor = pkgs.vscodium + "/bin/codium"; editor = lib.getExe pkgs.vscodium;
terminal = pkgs.alacritty + "/bin/alacritty"; terminal = lib.getExe pkgs.alacritty;
brightness = "${pkgs.swayosd}/bin/swayosd-client"; brightness = lib.getExe' pkgs.swayosd "swayosd-client";
brightness_up = "${brightness} --brightness=raise"; brightness_up = "${brightness} --brightness=raise";
brightness_down = "${brightness} --brightness=lower"; brightness_down = "${brightness} --brightness=lower";
volume = "${pkgs.swayosd}/bin/swayosd-client"; volume = brightness;
volume_up = "${volume} --output-volume=raise"; volume_up = "${volume} --output-volume=raise";
volume_down = "${volume} --output-volume=lower"; volume_down = "${volume} --output-volume=lower";
volume_mute = "${volume} --output-volume=mute-toggle"; volume_mute = "${volume} --output-volume=mute-toggle";
mic_mute = "${volume} --input-volume=mute-toggle"; mic_mute = "${volume} --input-volume=mute-toggle";
media = "${pkgs.playerctl}/bin/playerctl"; media = lib.getExe pkgs.playerctl;
media_play = "${media} play-pause"; media_play = "${media} play-pause";
media_next = "${media} next"; media_next = "${media} next";
media_prev = "${media} previous"; media_prev = "${media} previous";
# Sway desktop utilities # Sway desktop utilities
bar = pkgs.waybar + "/bin/waybar"; bar = lib.getExe pkgs.waybar;
launcher = pkgs.fuzzel + "/bin/fuzzel"; launcher = lib.getExe pkgs.fuzzel;
notifyd = pkgs.mako + "/bin/mako"; notifyd = lib.getExe pkgs.mako;
wallpaperd = pkgs.swaybg + "/bin/swaybg -i ${config.alyraffauf.desktop.theme.wallpaper}"; wallpaperd = lib.getExe pkgs.swaybg;
logout = pkgs.wlogout + "/bin/wlogout"; logout = lib.getExe pkgs.wlogout;
lock = pkgs.swaylock + ''/bin/swaylock''; lock = lib.getExe pkgs.swaylock;
idled = idled =
if config.alyraffauf.desktop.sway.autoSuspend if config.alyraffauf.desktop.sway.autoSuspend
then '' then ''
${pkgs.swayidle}/bin/swayidle -w \ ${lib.getExe pkgs.swayidle} -w \
timeout 240 '${pkgs.brightnessctl}/bin/brightnessctl -s set 10' \ timeout 240 '${lib.getExe pkgs.brightnessctl} -s set 10' \
resume '${pkgs.brightnessctl}/bin/brightnessctl -r' \ resume '${lib.getExe pkgs.brightnessctl} -r' \
timeout 300 '${lock}' \ timeout 300 '${lock}' \
timeout 330 '${config.wayland.windowManager.sway.package}/bin/swaymsg "output * dpms off"' \ timeout 330 '${lib.getExe' config.wayland.windowManager.sway.package "swaymsg"} "output * dpms off"' \
resume '${config.wayland.windowManager.sway.package}/bin/swaymsg "output * dpms on"' \ resume '${lib.getExe' config.wayland.windowManager.sway.package "swaymsg"} "output * dpms on"' \
timeout 900 '${pkgs.systemd}/bin/systemctl suspend' \ timeout 900 '${lib.getExe' pkgs.systemd "systemctl"} suspend' \
before-sleep '${media} pause' \ before-sleep '${media} pause' \
before-sleep '${lock}' before-sleep '${lock}'
'' ''
else '' else ''
${pkgs.swayidle}/bin/swayidle -w \ ${lib.getExe pkgs.swayidle} -w \
timeout 240 '${pkgs.brightnessctl}/bin/brightnessctl -s set 10' \ timeout 240 '${lib.getExe pkgs.brightnessctl} -s set 10' \
resume '${pkgs.brightnessctl}/bin/brightnessctl -r' \ resume '${lib.getExe pkgs.brightnessctl} -r' \
timeout 300 '${lock}' \ timeout 300 '${lock}' \
timeout 330 '${config.wayland.windowManager.sway.package}/bin/swaymsg "output * dpms off"' \ timeout 330 '${lib.getExe' config.wayland.windowManager.sway.package "swaymsg"} "output * dpms off"' \
resume '${config.wayland.windowManager.sway.package}/bin/swaymsg "output * dpms on"' \ resume '${lib.getExe' config.wayland.windowManager.sway.package "swaymsg"} "output * dpms on"' \
before-sleep '${media} pause' \ before-sleep '${media} pause' \
before-sleep '${lock}' before-sleep '${lock}'
''; '';
screenshot = "${pkgs.shotman}/bin/shotman"; screenshot = lib.getExe' pkgs.shotman "shotman";
# screenshot_folder = "~/pics/screenshots"; # screenshot_folder = "~/pics/screenshots";
# screenshot_screen = "${screenshot} ${screenshot_folder}/$(date +'%s_grim.png')"; # screenshot_screen = "${screenshot} ${screenshot_folder}/$(date +'%s_grim.png')";
# screenshot_region = "${screenshot} -m region -o ${screenshot_folder}"; # screenshot_region = "${screenshot} -m region -o ${screenshot_folder}";
@ -110,14 +110,14 @@
cycleSwayDisplayModes = pkgs.writeShellScriptBin "cycleSwayDisplayModes" '' cycleSwayDisplayModes = pkgs.writeShellScriptBin "cycleSwayDisplayModes" ''
# TODO: remove petalburg hardcodes # TODO: remove petalburg hardcodes
current_mode=$(${config.wayland.windowManager.sway.package}/bin/swaymsg -t get_outputs -p | grep "Current mode" | grep -Eo '[0-9]+x[0-9]+ @ [0-9.]+ Hz' | tr -d " " | grep 2880) current_mode=$(${lib.getExe' config.wayland.windowManager.sway.package "swaymsg"} -t get_outputs -p | grep "Current mode" | grep -Eo '[0-9]+x[0-9]+ @ [0-9.]+ Hz' | tr -d " " | grep 2880)
if [ $current_mode = "2880x1800@90.001Hz" ]; then if [ $current_mode = "2880x1800@90.001Hz" ]; then
${config.wayland.windowManager.sway.package}/bin/swaymsg output "eDP-1" mode "2880x1800@60.001Hz"; ${lib.getExe' config.wayland.windowManager.sway.package "swaymsg"} output "eDP-1" mode "2880x1800@60.001Hz";
${pkgs.libnotify}/bin/notify-send "Display set to 2880x1800@60.001Hz." ${lib.getExe pkgs.libnotify} "Display set to 2880x1800@60.001Hz."
elif [ $current_mode = "2880x1800@60.001Hz" ]; then elif [ $current_mode = "2880x1800@60.001Hz" ]; then
${config.wayland.windowManager.sway.package}/bin/swaymsg output "eDP-1" mode "2880x1800@90.001Hz"; ${lib.getExe' config.wayland.windowManager.sway.package "swaymsg"} output "eDP-1" mode "2880x1800@90.001Hz";
${pkgs.libnotify}/bin/notify-send "Display set to 2880x1800@90.001Hz." ${lib.getExe pkgs.libnotify} "Display set to 2880x1800@90.001Hz."
fi fi
''; '';
in { in {
@ -277,7 +277,7 @@
# For petalburg # For petalburg
"XF86Launch4" = "exec pp-adjuster"; "XF86Launch4" = "exec pp-adjuster";
"XF86Launch3" = "exec ${cycleSwayDisplayModes}/bin/cycleSwayDisplayModes"; "XF86Launch3" = "exec ${lib.getExe cycleSwayDisplayModes}";
# TODO: night color shift # TODO: night color shift
# "XF86Launch1" = # "XF86Launch1" =
@ -332,14 +332,14 @@
{command = "${fileManager} --daemon";} {command = "${fileManager} --daemon";}
{command = "${idled}";} {command = "${idled}";}
{command = "${notifyd}";} {command = "${notifyd}";}
{command = "${pkgs.autotiling}/bin/autotiling";} {command = "${lib.getExe pkgs.autotiling}";}
{command = "${pkgs.gammastep}/bin/gammastep -l 31.1:-94.1";} # TODO: automatic locations {command = "${lib.getExe pkgs.gammastep} -l 31.1:-94.1";} # TODO: automatic locations
{command = "${pkgs.mate.mate-polkit}/libexec/polkit-mate-authentication-agent-1";} {command = "${pkgs.mate.mate-polkit}/libexec/polkit-mate-authentication-agent-1";}
{command = "${pkgs.networkmanagerapplet}/bin/nm-applet";} {command = ''${lib.getExe' pkgs.networkmanagerapplet "nm-applet"}'';}
{command = "${pkgs.swayosd}/bin/swayosd-server";} {command = ''${lib.getExe' pkgs.swayosd "swayosd-server"}'';}
{command = "${pkgs.playerctl}/bin/playerctld";} {command = ''${lib.getExe' pkgs.playerctl "playerctld"}'';}
{command = "${pkgs.wl-clipboard}/bin/wl-paste --type image --watch ${pkgs.cliphist}/bin/cliphist store";} {command = ''${lib.getExe' pkgs.wl-clipboard "wl-paste"} --type image --watch ${lib.getExe pkgs.cliphist} store'';}
{command = "${pkgs.wl-clipboard}/bin/wl-paste --type text --watch ${pkgs.cliphist}/bin/cliphist store";} {command = ''${lib.getExe' pkgs.wl-clipboard "wl-paste"} --type text --watch ${lib.getExe pkgs.cliphist} store'';}
]; ];
output = { output = {
"BOE 0x095F Unknown" = { "BOE 0x095F Unknown" = {

View file

@ -14,10 +14,10 @@
while true; do while true; do
NEW_PIDS=() NEW_PIDS=()
monitor=`${config.wayland.windowManager.sway.package}/bin/swaymsg -t get_outputs -p | grep Output | awk '{print $2}'` monitor=`${lib.getExe' config.wayland.windowManager.sway.package "swaymsg"} -t get_outputs -p | grep Output | awk '{print $2}'`
for m in ''${monitor[@]}; do for m in ''${monitor[@]}; do
random_background=$(ls $directory/*.{png,jpg} | shuf -n 1) random_background=$(ls $directory/*.{png,jpg} | shuf -n 1)
${pkgs.swaybg}/bin/swaybg -o $m -i $random_background & ${lib.getExe pkgs.swaybg} -o $m -i $random_background &
NEW_PIDS+=($!) NEW_PIDS+=($!)
done done
@ -44,7 +44,7 @@ in {
home.packages = with pkgs; [swaybg sway-randomWallpaper]; home.packages = with pkgs; [swaybg sway-randomWallpaper];
wayland.windowManager.sway.config.startup = [ wayland.windowManager.sway.config.startup = [
{command = "${sway-randomWallpaper}/bin/sway-randomWallpaper";} {command = "${lib.getExe sway-randomWallpaper}";}
]; ];
}; };
} }

View file

@ -6,18 +6,18 @@
}: let }: let
pp-adjuster = pkgs.writeShellScriptBin "pp-adjuster" '' pp-adjuster = pkgs.writeShellScriptBin "pp-adjuster" ''
# Only works on petalburg. # Only works on petalburg.
current_profile=$(${pkgs.power-profiles-daemon}/bin/powerprofilesctl get | tr -d '[:space:]') current_profile=$(${lib.getExe' pkgs.power-profiles-daemon "powerprofilesctl"} get | tr -d '[:space:]')
if [ "$current_profile" == "power-saver" ]; then if [ "$current_profile" == "power-saver" ]; then
${pkgs.power-profiles-daemon}/bin/powerprofilesctl set balanced ${lib.getExe' pkgs.power-profiles-daemon "powerprofilesctl"} set balanced
elif [ "$current_profile" == "balanced" ]; then elif [ "$current_profile" == "balanced" ]; then
${pkgs.power-profiles-daemon}/bin/powerprofilesctl set performance ${lib.getExe' pkgs.power-profiles-daemon "powerprofilesctl"} set performance
elif [ "$current_profile" == "performance" ]; then elif [ "$current_profile" == "performance" ]; then
${pkgs.power-profiles-daemon}/bin/powerprofilesctl set power-saver ${lib.getExe' pkgs.power-profiles-daemon "powerprofilesctl"} set power-saver
fi fi
new_profile=$(${pkgs.power-profiles-daemon}/bin/powerprofilesctl get | tr -d '[:space:]') new_profile=$(${lib.getExe' pkgs.power-profiles-daemon "powerprofilesctl"} get | tr -d '[:space:]')
${pkgs.libnotify}/bin/notify-send "Power profile set to $new_profile." ${lib.getExe pkgs.libnotify} "Power profile set to $new_profile."
''; '';
in { in {
options = {alyraffauf.scripts.pp-adjuster.enable = lib.mkEnableOption "Enable pp-adjuster script.";}; options = {alyraffauf.scripts.pp-adjuster.enable = lib.mkEnableOption "Enable pp-adjuster script.";};