move wallpapers
This commit is contained in:
parent
087842b218
commit
ca53d289d4
4 changed files with 27 additions and 29 deletions
|
@ -23,6 +23,7 @@ in
|
|||
./downloader.nix
|
||||
./firefox.nix
|
||||
./media.nix
|
||||
./misc.nix
|
||||
./persistence.nix
|
||||
./scripts.nix
|
||||
./sway
|
||||
|
|
3
home/misc.nix
Normal file
3
home/misc.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{ pkgs, ... }: {
|
||||
xdg.dataFile."wallpapers/catppuccin".source = "${pkgs.catppuccin-wallpapers}/share/wallpapers";
|
||||
}
|
|
@ -1,13 +1,32 @@
|
|||
{ osConfig
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
{ osConfig, pkgs, ... }:
|
||||
let
|
||||
notify-send = "${pkgs.libnotify}/bin/notify-send";
|
||||
dmenu = "${pkgs.rofi-wayland}/bin/rofi -dmenu";
|
||||
in
|
||||
{
|
||||
xdg.configFile = {
|
||||
"scripts/chpaper.sh" = {
|
||||
text = ''
|
||||
#!/bin/sh
|
||||
|
||||
set -eu
|
||||
|
||||
DIR="''${HOME}/.local/share/wallpapers"
|
||||
|
||||
random_paper() {
|
||||
find -L "''${DIR}"/ -type f -regextype egrep -regex ".*\.(jpe?g|png)$" | shuf -n1
|
||||
}
|
||||
|
||||
SWAYSOCK="''${SWAYSOCK:-""}"
|
||||
if [ -z "''${SWAYSOCK}" ] ; then
|
||||
SWAYSOCK="$(find /run/user/"$(id -u)"/ -name "sway-ipc.$(id -u).*.sock")"
|
||||
export SWAYSOCK
|
||||
fi
|
||||
${pkgs.imagemagick}/bin/convert "$(random_paper)" /tmp/wallpaper.jpg && swaymsg "output * bg '/tmp/wallpaper.jpg' fill" &
|
||||
${pkgs.imagemagick}/bin/convert "$(random_paper)" /tmp/lockpaper.jpg
|
||||
'';
|
||||
executable = true;
|
||||
};
|
||||
"scripts/power_menu.sh" = {
|
||||
executable = true;
|
||||
text = ''
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
{ pkgs, ... }: {
|
||||
xdg.dataFile."wallpapers/catppuccin".source = "${pkgs.catppuccin-wallpapers}/share/wallpapers";
|
||||
xdg.configFile."scripts/chpaper.sh" = {
|
||||
text = ''
|
||||
#!/bin/sh
|
||||
|
||||
set -eu
|
||||
|
||||
DIR="''${HOME}/.local/share/wallpapers"
|
||||
|
||||
random_paper() {
|
||||
find -L "''${DIR}"/ -type f -regextype egrep -regex ".*\.(jpe?g|png)$" | shuf -n1
|
||||
}
|
||||
|
||||
SWAYSOCK="''${SWAYSOCK:-""}"
|
||||
if [ -z "''${SWAYSOCK}" ] ; then
|
||||
SWAYSOCK="$(find /run/user/"$(id -u)"/ -name "sway-ipc.$(id -u).*.sock")"
|
||||
export SWAYSOCK
|
||||
fi
|
||||
${pkgs.imagemagick}/bin/convert "$(random_paper)" /tmp/wallpaper.jpg && swaymsg "output * bg '/tmp/wallpaper.jpg' fill" &
|
||||
${pkgs.imagemagick}/bin/convert "$(random_paper)" /tmp/lockpaper.jpg
|
||||
'';
|
||||
executable = true;
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue