From 2a7506bfbfcd63d445c89acb3bada95a47c58b8c Mon Sep 17 00:00:00 2001 From: Amy Retzerau Date: Fri, 10 Jan 2025 23:09:51 +0100 Subject: [PATCH] switched to uwsm --- .config/hypr/hyprland.conf | 25 +++++++++---------- .../hypridle.service | 1 + .../wallpaper.service | 1 + .../waybar.service | 1 + .config/systemd/user/keepassxc.service | 15 +++++++++++ .config/systemd/user/wallpaper.service | 8 ++++++ .config/systemd/user/wallpaper.timer | 8 +++--- wallpaper/script.sh | 13 +++++++--- 8 files changed, 52 insertions(+), 20 deletions(-) create mode 120000 .config/systemd/user/graphical-session.target.wants/hypridle.service create mode 120000 .config/systemd/user/graphical-session.target.wants/wallpaper.service create mode 120000 .config/systemd/user/graphical-session.target.wants/waybar.service create mode 100644 .config/systemd/user/keepassxc.service diff --git a/.config/hypr/hyprland.conf b/.config/hypr/hyprland.conf index 86fe4dc..b10bb0d 100644 --- a/.config/hypr/hyprland.conf +++ b/.config/hypr/hyprland.conf @@ -37,7 +37,7 @@ monitor= DP-3, 2560x1440@74.97,0x-1440,1 # Set programs that you use $terminal = kitty $fileManager = dolphin -$menu = rofi -show run +$menu = rofi -show run -run-command "uwsm app -- {cmd}" -show-icons ################# @@ -50,12 +50,11 @@ $menu = rofi -show run # exec-once = $terminal # exec-once = nm-applet & # exec-once = waybar & hyprpaper & firefox -exec-once = waybar -exec-once = dunst -exec-once = hypridle -exec-once = systemctl --user start hyprpolkitagent -exec-once = syncthing -exec-once = keepassxc +#exec-once = ~/wallpaper/script.sh +exec-once = uwsm app -- dunst +#exec-once = uwsm app -- systemctl --user start hyprpolkitagent +exec-once = uwsm app -- syncthing +exec-once = uwsm app -- keepassxc #exec-once = nwg-dock-hyprland -x -mb 10 -mt -10 ############################# ### ENVIRONMENT VARIABLES ### @@ -200,7 +199,7 @@ master { # https://wiki.hyprland.org/Configuring/Variables/#misc misc { force_default_wallpaper = 2 # Set to 0 or 1 to disable the anime mascot wallpapers - disable_hyprland_logo = false # If true disables the random hyprland logo / anime girl background. :( + disable_hyprland_logo = true # If true disables the random hyprland logo / anime girl background. :( } @@ -263,17 +262,17 @@ $mainMod = SUPER # Sets "Windows" key as main modifier #bind = $mainMod, W,exec, rofi -show run # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more -bind = $mainMod, Q, exec, $terminal +bind = $mainMod, Q, exec, uwsm app -- $terminal bind = $mainMod, C, killactive, -bind = $mainMod, M, exit, -bind = $mainMod, E, exec, $fileManager +bind = $mainMod, M, exec, uwsm stop +bind = $mainMod, E, exec, uwsm app -- $fileManager bind = $mainMod, V, togglefloating, -bind = $mainMod, R, exec, $menu +bind = $mainMod, R, exec, uwsm app -- $menu bind = $mainMod, P, pseudo, # dwindle bind = $mainMod, J, togglesplit, # dwindle #bind = $mainMod, L, exec, hyprlock & sleep 1 ; systemctl suspend #bind = $mainMod, L, exec, hyprlock -bind = $mainMod, L, exec, swaylock +bind = $mainMod, L, exec, uwsm app -- swaylock # Move focus with mainMod + arrow keys bind = $mainMod, left, movefocus, l bind = $mainMod, right, movefocus, r diff --git a/.config/systemd/user/graphical-session.target.wants/hypridle.service b/.config/systemd/user/graphical-session.target.wants/hypridle.service new file mode 120000 index 0000000..55da293 --- /dev/null +++ b/.config/systemd/user/graphical-session.target.wants/hypridle.service @@ -0,0 +1 @@ +/usr/lib/systemd/user/hypridle.service \ No newline at end of file diff --git a/.config/systemd/user/graphical-session.target.wants/wallpaper.service b/.config/systemd/user/graphical-session.target.wants/wallpaper.service new file mode 120000 index 0000000..5d56836 --- /dev/null +++ b/.config/systemd/user/graphical-session.target.wants/wallpaper.service @@ -0,0 +1 @@ +/home/amy/.config/systemd/user/wallpaper.service \ No newline at end of file diff --git a/.config/systemd/user/graphical-session.target.wants/waybar.service b/.config/systemd/user/graphical-session.target.wants/waybar.service new file mode 120000 index 0000000..c2a0b64 --- /dev/null +++ b/.config/systemd/user/graphical-session.target.wants/waybar.service @@ -0,0 +1 @@ +/usr/lib/systemd/user/waybar.service \ No newline at end of file diff --git a/.config/systemd/user/keepassxc.service b/.config/systemd/user/keepassxc.service new file mode 100644 index 0000000..80ebbc6 --- /dev/null +++ b/.config/systemd/user/keepassxc.service @@ -0,0 +1,15 @@ +[Unit] +Description=Fast, IPC-controlled wallpaper utility for Hyprland. +Documentation=https://wiki.hyprland.org/Hypr-Ecosystem/hyprpaper/ +PartOf=graphical-session.target +Requires=waybar.service +ConditionEnvironment=WAYLAND_DISPLAY + +[Service] +Type=simple +ExecStart=/usr/bin/keepassxc +Slice=session.slice +Restart=on-failure + +[Install] +WantedBy=graphical-session.target diff --git a/.config/systemd/user/wallpaper.service b/.config/systemd/user/wallpaper.service index 891cb02..a235a0f 100644 --- a/.config/systemd/user/wallpaper.service +++ b/.config/systemd/user/wallpaper.service @@ -1,6 +1,14 @@ [Unit] Description=Time based wallpaper switcher +PartOf=graphical-session.target +Requires=graphical-session.target +After=graphical-session.target +ConditionEnvironment=WAYLAND_DISPLAY [Service] Type=simple ExecStart=%h/wallpaper/script.sh + + +[Install] +WantedBy=graphical-session.target diff --git a/.config/systemd/user/wallpaper.timer b/.config/systemd/user/wallpaper.timer index 1db6d86..bb392ad 100644 --- a/.config/systemd/user/wallpaper.timer +++ b/.config/systemd/user/wallpaper.timer @@ -1,8 +1,10 @@ [Unit] Description=Run foo weekly and on boot +Requires=graphical-session.target [Timer] -OnCalendar=minutely -Persistent=false +OnCalendar=hourly +Persistent=true + [Install] -WantedBy=timers.target +WantedBy=graphical-session.target diff --git a/wallpaper/script.sh b/wallpaper/script.sh index e968e73..77e1173 100755 --- a/wallpaper/script.sh +++ b/wallpaper/script.sh @@ -1,15 +1,20 @@ #!/bin/bash - +pidof hyprpaper || hyprctl dispatch exec hyprpaper PATHNAME=~/wallpaper/ cd $PATHNAME printf -v date "%(%H)T" +until pid=$(hyprctl hyprpaper listloaded) +do + sleep 1 +done + LAST=-1 FOUND=-1 -for filename in $(ls *.png | sort -g) +for filename in $(ls *.{jpg,JPG,png,PNG} | sort -g) do - if ((${filename%%.*} >= date && ${FOUND%%.*} == -1));then - echo ${FOUND%%.*} + if ((${filename%%.*} > date && ${FOUND%%.*} == -1));then + #echo ${FOUND%%.*} FOUND=$LAST if ((${FOUND%%.*}==-1));then FOUND=-2