add randomwp

This commit is contained in:
Torjus Håkestad 2024-03-04 09:10:58 +01:00
parent 705c9ba011
commit eba67abc2a
4 changed files with 42 additions and 6 deletions

View File

@ -1,3 +1 @@
preload = ~/pics/wallpapers/1.jpg
wallpaper = eDP-1,~/pics/wallpapers/1.jpg
splash = false

View File

@ -7,4 +7,8 @@
source = ./rofi-launcher.sh;
executable = true;
};
home.file.".local/bin/randomwp" = {
source = ./randomwp.sh;
executable = true;
};
}

31
home/scripts/randomwp.sh Normal file
View File

@ -0,0 +1,31 @@
#!/usr/bin/env bash
set -eo pipefail
if [ -z "${WALLPAPER_DIR}" ]; then
WALLPAPER_DIR="${HOME}/wallpapers"
fi
if ! [ -d "$WALLPAPER_DIR" ]; then
echo "Wallpaper dir is not a directory"
exit 1
fi
wallpaper_path=$(find "$WALLPAPER_DIR" -mindepth 1 | sort -R | tail -n 1)
if [ -z "$wallpaper_path" ]; then
echo "Unable to find wallpaper"
exit 1
fi
if ! command -v hyprpaper &> /dev/null; then
echo "Could not find hyprpaper command"
exit 1
fi
echo "setting $wallpaper_path as wallpaper"
hyprctl hyprpaper unload all
hyprctl hyprpaper preload "$wallpaper_path"
for monitor in $(hyprctl monitors | grep 'Monitor' | awk '{ print $2 }'); do
hyprctl hyprpaper wallpaper "$monitor,$wallpaper_path"
done

View File

@ -1,12 +1,15 @@
{ pkgs, ... }: {
programs.ssh = {
enable = true;
controlMaster = "auto";
matchBlocks."bmo.uio.no" = {
hostname = "bmo.uio.no";
extraOptions = {
ControlMaster = "auto";
ControlPath = "$XDG_RUNTIME_DIR/ssh/%r@%h:%p";
setEnv = {
# TERM = "xterm-256color";
};
hostname = "bmo.uio.no";
forwardAgent = false;
proxyJump = "torjus@rlogin.uio.no";
};
};
}