]> Freerunner's - dotfiles.git/commitdiff
hypr: make startup script more robust
authorAndre Ramnitz <tux.rising@gmail.com>
Mon, 3 Mar 2025 22:39:21 +0000 (23:39 +0100)
committerAndre Ramnitz <tux.rising@gmail.com>
Mon, 3 Mar 2025 22:39:21 +0000 (23:39 +0100)
dot-config/hypr/scripts/gammarelay-auto-temp.py
dot-config/hypr/scripts/keepassxc.sh [new file with mode: 0755]
dot-config/hypr/scripts/startup.sh

index 9fac7e38945f5a878d989053a787a7659dddbe61..72b93a3f310839883d96fdecfe9bf9f8d5f78bdc 100755 (executable)
@@ -10,7 +10,7 @@ def mk_time(hours, minutes, seconds=0):
     return hours * 3600.0 + minutes * 60.0 + seconds
 
 TEMP_DAY = 6500.0
-TEMP_NIGHT = 3800.0
+TEMP_NIGHT = 4200.0
 
 DAWN_TIME = mk_time( 7, 48) # 9:00 (Should be > WINDOW)
 DUSK_TIME = mk_time(16,  45) # 19:00 (Shoulbe be > WINDOW + DAWN_TIME)
diff --git a/dot-config/hypr/scripts/keepassxc.sh b/dot-config/hypr/scripts/keepassxc.sh
new file mode 100755 (executable)
index 0000000..034b2e6
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/bash
+#
+# See https://github.com/nextcloud/desktop/issues/1011
+#
+############################################
+# Adjust the following to suit your needs
+MAX_TRIES=3          # Max. number of tries to ask for password
+############################################
+i=0
+while [ $i -lt $MAX_TRIES ]; do
+  ((i++))
+  open="$(qdbus6 org.kde.kwalletd6 /modules/kwalletd6 isOpen kdewallet)"
+  if [ "$open" = "true" ]; then
+    break
+  fi
+  qdbus6 org.kde.kwalletd6 /modules/kwalletd6 open kdewallet 0 "nextcloud-client-starter" > /dev/null
+done
+exec nextcloud --background
+
index 40dfdeed6798864d817b2d479d44d76bb33fee31..ff1e97ab52a2f84444a9247f63990abbfc2061a5 100755 (executable)
@@ -1,14 +1,15 @@
 #!/usr/bin/env bash
+# shellcheck disable=SC2015
 
 logger '============================'
 logger 'HYPRLAND MAIN STARTUP BEGIN'
-# shellcheck disable=SC2155
-# shellcheck disable=SC2046
+
+# shellcheck disable=SC2155,SC2046
 test ! -d "$XDG_RUNTIME_DIR" && export XDG_RUNTIME_DIR=$(mktemp -d /tmp/$(id -u)-runtime-dir.XXX) && logger 'xdg-runtime dir set NOW'
 test ! "$DBUS_SESSION_BUS_ADDRESS" && dbus-daemon --session --address=unix:path="$XDG_RUNTIME_DIR"/bus && logger 'dbus session daemon started'
 dbus-update-activation-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
 
-export PATH="$HOME/.local/bin:$HOME/.cargo/bin:$HOME/go/bin:$HOME/Applications:$PATH"
+export PATH="$HOME/.local/bin:$HOME/.cargo/bin:$HOME/go/bin:$HOME/Applications:$PATH"
 
 #------------------------------------------------------ xdg-desktop-portal
 killall -e xdg-desktop-portal-hyprland
@@ -27,7 +28,7 @@ sleep 2
 test -f /usr/libexec/xdg-desktop-portal && /usr/libexec/xdg-desktop-portal &
 
 #------------------------------------------------------ polkit-kde
-if [[ ! $(pidof /usr/libexec/polkit-kde-authentication-agent-1) ]]; then
+if ! pidof /usr/libexec/polkit-kde-authentication-agent-1; then
     if ! command -v /usr/libexec/polkit-kde-authentication-agent-1 &> /dev/null
     then
         echo "polkit-kde not installed"
@@ -60,9 +61,10 @@ pidof swaync && pkill swaync || swaync > /dev/null 2>&1 &
 pidof openrgb && pkill openrgb || openrgb -p default --startminimized &
 pidof udiskie && pkill udiskie || udiskie --no-automount --no-notify --tray &
 pidof corectrl && pkill corectrl || corectrl --minimize-systray > /dev/null 2>&1 &
-! pidof keepassxc && keepassxc > /dev/null 2>&1 &
 
-# ! pidof kwalletmanager5 && /usr/libexec/pam_kwallet_init &
+if pidof kwalletd6; then
+       ~/.config/hypr/scripts/keepassxc.sh
+fi
 
 ! pidof swww-daemon && nohup /usr/bin/swww-daemon > /dev/null 2>&1
 sleep 0.5 && ~/.local/bin/rndwallpaper swww