feat: add change wallpaper shortcut to yazi
This commit is contained in:
parent
d1f25b377f
commit
c45ba82b90
18 changed files with 188 additions and 21 deletions
|
|
@ -2,9 +2,11 @@
|
|||
let
|
||||
mkWall = pkgs.writeShellScriptBin "setWall" ''
|
||||
url="$1"
|
||||
filepath="/tmp/wall_cache/$(echo -n "$url" | base64 | tr -d '\n')"
|
||||
DIR="$HOME/Pictures/Wallpapers"
|
||||
filepath="$DIR/$(echo -n "$url" | sha256sum | awk '{print $1}' | tr -d '\n').jpg"
|
||||
|
||||
if [[ ! -f "$filepath" ]]; then
|
||||
${pkgs.libnotify}/bin/notify-send " Wallpaper" "$filepath\nDownloading..."
|
||||
curl -sL "$url" -o "$filepath"
|
||||
fi
|
||||
|
||||
|
|
|
|||
|
|
@ -14,4 +14,18 @@
|
|||
pull.rebase = true;
|
||||
};
|
||||
};
|
||||
|
||||
programs.gh = {
|
||||
enable = true;
|
||||
settings = {
|
||||
git_protocol = "ssh";
|
||||
aliases = {
|
||||
co = "pr checkout";
|
||||
pv = "pr view";
|
||||
};
|
||||
};
|
||||
gitCredentialHelper = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,11 +2,13 @@
|
|||
pkgs,
|
||||
lib,
|
||||
inputs,
|
||||
config,
|
||||
system,
|
||||
osConfig,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (osConfig.systemConf) username;
|
||||
inherit (osConfig.systemConf.hyprland) monitors;
|
||||
terminal = "ghostty";
|
||||
|
||||
|
|
@ -37,6 +39,10 @@ in
|
|||
sunsetr
|
||||
];
|
||||
|
||||
systemd.user.tmpfiles.rules = [
|
||||
"d ${config.home.homeDirectory}/Pictures/Wallpapers 0744 ${username} users -"
|
||||
];
|
||||
|
||||
imports = [
|
||||
(import ./hypr/bind.nix { inherit mainMod; })
|
||||
./hypr/workspace.nix
|
||||
|
|
|
|||
|
|
@ -59,7 +59,8 @@ let
|
|||
|
||||
# Change Wallpaper
|
||||
wallRand = pkgs.writeShellScript "wallRand" ''
|
||||
mapfile -t wallpapers < <(find /tmp/wall_cache -type f)
|
||||
WALLPAPER_DIR="$HOME/Pictures/Wallpapers"
|
||||
mapfile -t wallpapers < <(find "$WALLPAPER_DIR" -type f)
|
||||
|
||||
count="''${#wallpapers[@]}"
|
||||
|
||||
|
|
@ -71,7 +72,7 @@ let
|
|||
exit 1
|
||||
fi
|
||||
|
||||
${config.services.swww.package}/bin/swww img $selected --transition-fps 45 --transition-duration 1 --transition-type random
|
||||
${config.services.swww.package}/bin/swww img "$selected" --transition-fps 45 --transition-duration 1 --transition-type random
|
||||
'';
|
||||
|
||||
rbwSelector = import ../scripts/rbwSelector.nix { inherit pkgs; };
|
||||
|
|
@ -439,7 +440,7 @@ in
|
|||
on-click-middle = "close";
|
||||
ignore-list = [
|
||||
"rofi"
|
||||
"chromium"
|
||||
"chromium-browser"
|
||||
"firefox"
|
||||
"firefox-nightly"
|
||||
"zen"
|
||||
|
|
|
|||
|
|
@ -61,6 +61,13 @@ in
|
|||
};
|
||||
|
||||
opener = {
|
||||
set-wallpaper = [
|
||||
{
|
||||
run = ''${pkgs.swww}/bin/swww img "$1" --transition-fps 45 --transition-duration 1 --transition-type random'';
|
||||
for = "linux";
|
||||
desc = "Set as wallpaper";
|
||||
}
|
||||
];
|
||||
edit = [
|
||||
{
|
||||
run = ''''\${EDITOR:=nvim} "$@"'';
|
||||
|
|
@ -98,6 +105,15 @@ in
|
|||
keymap = {
|
||||
mgr = {
|
||||
prepend_keymap = [
|
||||
# Set Wallpaper
|
||||
{
|
||||
on = [
|
||||
"g"
|
||||
"w"
|
||||
];
|
||||
run = ''shell -- ${pkgs.swww}/bin/swww img "$1" --transition-fps 45 --transition-duration 1 --transition-type random'';
|
||||
desc = "Set as wallpaper";
|
||||
}
|
||||
# Git Changes
|
||||
{
|
||||
on = [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue