mirror of
https://github.com/alyraffauf/nixcfg.git
synced 2024-11-22 02:13:55 -05:00
river: added random background with swaybg
This commit is contained in:
parent
9f2de2ba5a
commit
0c907e69fc
|
@ -10,7 +10,7 @@
|
|||
|
||||
if [ -d "$directory" ]; then
|
||||
while true; do
|
||||
sleep 30
|
||||
sleep 30
|
||||
hyprctl hyprpaper unload all
|
||||
for m in ''${monitor[@]}; do
|
||||
random_background=$(ls $directory/*.{png,jpg} | shuf -n 1)
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
config,
|
||||
...
|
||||
}: {
|
||||
imports = [./randomWallpaper.nix];
|
||||
options = {
|
||||
desktopEnv.river.enable =
|
||||
lib.mkEnableOption "Enable riverwm with extra apps.";
|
||||
|
@ -41,8 +42,13 @@
|
|||
xfce.xfce4-settings
|
||||
xfce.xfce4-taskmanager
|
||||
xfce.xfconf
|
||||
swayidle
|
||||
];
|
||||
|
||||
desktopEnv.river.randomWallpaper.enable = lib.mkDefault true;
|
||||
|
||||
programs.swaylock.enable = lib.mkDefault true;
|
||||
|
||||
services.cliphist.enable = lib.mkDefault true;
|
||||
services.kanshi.enable = true;
|
||||
services.kanshi.profiles.framework = {
|
||||
|
@ -162,6 +168,7 @@
|
|||
pkill -f nm-applet
|
||||
pkill -f swayosd-server
|
||||
pkill -f waybar
|
||||
pkill -f swayidle
|
||||
|
||||
touchpad=`riverctl list-inputs|grep -i touchpad`
|
||||
for t in ''${touchpad[@]}; do
|
||||
|
@ -326,6 +333,7 @@
|
|||
swayosd-server &
|
||||
thunar --daemon &
|
||||
waybar &
|
||||
swayidle -w timeout 300 'swaylock -f -c 000000' before-sleep 'swaylock -f -c 000000' &
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
31
homeManagerModules/desktopEnv/river/randomWallpaper.nix
Normal file
31
homeManagerModules/desktopEnv/river/randomWallpaper.nix
Normal file
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
swaybg-random = pkgs.writeShellScriptBin "swaybg-random" ''
|
||||
directory=${config.home.homeDirectory}/.local/share/backgrounds
|
||||
|
||||
if [ -d "$directory" ]; then
|
||||
while true; do
|
||||
kill `pidof swaybg`
|
||||
random_background=$(ls $directory/*.{png,jpg} | shuf -n 1)
|
||||
swaybg -i $random_background
|
||||
sleep 900
|
||||
done
|
||||
fi
|
||||
'';
|
||||
in {
|
||||
options = {
|
||||
desktopEnv.river.randomWallpaper.enable =
|
||||
lib.mkEnableOption "Enables swaybg random wallpaper script.";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.desktopEnv.river.randomWallpaper.enable {
|
||||
# Packages that should be installed to the user profile.
|
||||
home.packages = with pkgs; [swaybg swaybg-random];
|
||||
|
||||
wayland.windowManager.river.extraConfig = "swaybg-random &";
|
||||
};
|
||||
}
|
|
@ -5,4 +5,6 @@
|
|||
...
|
||||
}: {
|
||||
imports = [./hyprland];
|
||||
|
||||
security.pam.services.swaylock = {};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue