Skip to content

Commit 82361f0

Browse files
committed
Closes #1153 Closes #1160 Closes #1163
1 parent 0021863 commit 82361f0

File tree

9 files changed

+113
-25
lines changed

9 files changed

+113
-25
lines changed

CHANGELOG.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,26 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
1212
- Dunst: Fix dunst crashing when the font cannot handle unsupported characters -- Thanks to [#1131](https://github.com/HyDE-Project/HyDE/issues/1131)
1313
- UWSM: Clean up the xdg freedesktop.org spec as uwsm handles it
1414
- Wallpaper: fix #1136 as exporting arrays are not supported in bash
15+
- Lockscreen: Fix zombie hyprlock
1516

1617
### Changed
1718

1819
- Core: Move wallbash to ~/.local/share/wallbash
19-
- wlogout: Add support for for uwsm
20+
- Wlogout: Add support for for uwsm
2021
- Flatpak: make themes,icons as rw for flatpak --user
2122
- Added multi-gpu message to nvidia.conf
22-
- logs now will have '*.log' as extension
23+
- Logs now will have '\*.log' as extension
24+
- Waybar: run as a systemd scope unit on startup
25+
- Wallpaper: run as a systemd scope unit on startup
2326

2427
### Added
2528

2629
- hyde-shell: Add 'logout' command to handle with/out uwsm
2730
- waybar: Add lighter temperature module (Needs manual setup)
2831
- Add credits page
2932
- waybar: Try to force initialization on restore (redundancy) might fix [#1160](https://github.com/HyDE-Project/HyDE/issues/1160)
33+
- Added pyprland boilerplate, no configs for now
34+
- Hyprland: Graciously handle some of the issues hyprland config issues for unknown SHELL
3035

3136
## v25.8.1
3237

Configs/.config/hyde/wallbash/scripts/spotify.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,9 @@ if (pkg_installed spotify && pkg_installed spicetify-cli) || [ -n "$spotify_path
8585
if pgrep -x spotify >/dev/null; then
8686
pkill -x spicetify
8787
spicetify -q watch -s &
88+
sleep 3
89+
if pgrep -x spicetify >/dev/null; then
90+
spicetify restart
91+
fi
8892
fi
8993
fi

Configs/.config/hypr/hypridle.conf

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
# hypridle.conf - Hypridle configuration for HyDE
55
# Handles idle actions: dim, lock, DPMS, suspend, and custom listeners
66
#
7-
# $LOCKSCREEN: Command to lock the screen (set to your preferred lockscreen)
8-
#
97
# Listeners: Each listener block defines an idle timeout and actions to run
108
#
119
# For more info, see: https://wiki.hypr.land/Hypr-Ecosystem/hypridle/
@@ -18,23 +16,22 @@
1816
#!  ░▒▒░░▓▓   ▓▓   \__  |____/ |____/
1917
#!    ░▒▓▓   ▓▓  //____/
2018

21-
# $LOCKSCREEN = hyprlock # preferred LOCKSCREEN e.g swaylock
22-
$LOCKSCREEN = hyde-shell lockscreen # Calls $LOCKSCREEN
19+
$LOCK_CMD = hyde-shell lockscreen.sh # Calls $LOCKSCREEN default is hyprlock
20+
$UNLOCK_CMD = sh -c 'sleep 3 && pkill -9 $(hyde-shell lockscreen --get)' # kills the lockscreen after 3 seconds for cleanup
2321

24-
# // --- General hypridle settings ---
2522
general {
26-
lock_cmd = $LOCKSCREEN # Registers the lockscreen command to dbus so it can be invoked by `loginctl lock-session`
27-
# unlock_cmd = #notify-send "unlock!" # Command to run on unlock (optional)
28-
before_sleep_cmd = loginctl lock-session # Locks before sleep
29-
# after_sleep_cmd = # notify-send "Awake!" # Command after waking up (optional)
23+
lock_cmd = $LOCK_CMD # command when `loginctl lock-session` is called
24+
unlock_cmd = $UNLOCK_CMD # command when `loginctl unlock-session` is called
3025
ignore_dbus_inhibit = false # Ignore dbus idle-inhibit requests (false = respect them)
3126
ignore_systemd_inhibit = false # Ignore systemd-inhibit --what=idle (false = respect them)
27+
# before_sleep_cmd = # command ran before sleep
28+
# after_sleep_cmd = # notify-send "Awake!" # command ran after sleep
3229
}
3330

3431
# // --- Listener: Dim display after 60s idle ---
3532
listener {
3633
timeout = 60
37-
on-timeout = { brightnessctl -s && brightnessctl s 1% ;} # Save and set brightness to 1%
34+
on-timeout = brightnessctl -s && brightnessctl s 1% # Save and set brightness to 1%
3835
on-resume = brightnessctl -r # Restore brightness on activity
3936
}
4037

Configs/.local/bin/hyde-shell

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,51 @@ run_command() {
445445
fi
446446
}
447447

448+
run_pip() {
449+
python_activate
450+
shift
451+
pip "$@"
452+
}
453+
454+
run_pypr() {
455+
456+
python_activate
457+
shift
458+
459+
if command -v pypr >/dev/null 2>&1; then
460+
461+
socket_path="${XDG_RUNTIME_DIR}/hypr/${HYPRLAND_INSTANCE_SIGNATURE}/.pyprland.sock"
462+
463+
if [[ -S "$socket_path" ]] && pgrep -u "$USER" pypr >/dev/null 2>&1; then
464+
exec app2unit.sh pypr "$@"
465+
else
466+
print_log -sec "pypr" "PyPR is not running properly, starting fresh"
467+
rm "$socket_path"
468+
469+
exec app2unit.sh -t service pypr
470+
fi
471+
472+
else
473+
pip install --no-input pyprland==2.4.7
474+
fi
475+
476+
}
477+
478+
lock_session() {
479+
#? hyde-shell lock-session wraps around the lockscreen.sh script
480+
#? lockscreen.sh activates the set lockscreen blindly
481+
#? however, lock-session will check if the lockscreen is set FD's ScreenSaver
482+
#? if it is, it will use loginctl lock-session
483+
#? otherwise, it will use lockscreen.sh
484+
if busctl --user list | grep -q "org.freedesktop.ScreenSaver"; then
485+
echo "Using org.freedesktop.ScreenSaver for locking"
486+
loginctl lock-session
487+
else
488+
lockscreen.sh
489+
fi
490+
491+
}
492+
448493
#*--------------------------------------------------------------------------------
449494

450495
if [[ -z "${BASH_SOURCE[0]}" ]]; then
@@ -476,7 +521,10 @@ init | --init)
476521
initialized
477522
exit 0
478523
;;
479-
524+
lock-session)
525+
lock_session
526+
exit 0
527+
;;
480528
*)
481529
export HYDE_SHELL_INIT=1
482530
;;
@@ -496,6 +544,16 @@ if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
496544
logout)
497545
hyde-logout
498546
;;
547+
548+
pypr)
549+
run_pypr "${@}"
550+
exit 0
551+
;;
552+
553+
pip)
554+
run_pip "${@}"
555+
exit 0
556+
;;
499557
-r | reload)
500558
hyde_reload
501559
;;
Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
11
#!/usr/bin/env bash
22

3-
scrDir="$(dirname "$(realpath "$0")")"
4-
# shellcheck source=$HOME/.local/lib/hyde/globalcontrol.sh
5-
# shellcheck disable=SC1091
6-
source "${scrDir}/globalcontrol.sh"
7-
3+
[[ "${HYDE_SHELL_INIT}" -ne 1 ]] && eval "$(hyde-shell init)"
84
lockscreen="${LOCKSCREEN:-hyprlock}"
95

10-
if ! hyde-shell "${lockscreen}.sh" "${@}"; then
6+
case ${1} in
7+
--get)
8+
echo "${lockscreen}"
9+
exit 0
10+
;;
11+
esac
12+
13+
#? To cleanly exit hyprlock we should use a systemd scope unit.
14+
#? This allows us to manage the lockscreen process more effectively.
15+
#? This fix the zombie process issue when hyprlock is unlocked but still running.
16+
unit_id=(-u "hyde-lockscreen.scope")
17+
18+
if app2unit.sh --test "${unit_id[@]}" -- "${lockscreen}.sh" "${@}"; then
19+
printf "Executing ${lockscreen} wrapper script : %s\n" "${lockscreen}.sh"
20+
app2unit.sh "${unit_id[@]}" -- "${lockscreen}.sh" "${@}"
21+
else
1122
printf "Executing raw command: %s\n" "${lockscreen}"
12-
app2unit.sh "${lockscreen}" "${@}"
23+
app2unit.sh "${unit_id[@]}" -- "${lockscreen}" "${@}"
1324
fi

Configs/.local/share/hyde/hyprland.conf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# hyprlang if !XDG_DATA_HOME
1717
$XDG_DATA_HOME = $HOME/.local/share
1818
# hyprlang endif
19+
1920
# hyprlang if !XDG_CONFIG_HOME
2021
$XDG_CONFIG_HOME = $HOME/.config
2122
# hyprlang endif
@@ -26,6 +27,7 @@ $XDG_CONFIG_HOME = $HOME/.config
2627
source = $XDG_DATA_HOME/hypr/env.conf
2728

2829
# hyprlang if !CONFIG_ALREADY_LOADED
30+
2931
# ? Variables
3032
source = $XDG_DATA_HOME/hypr/variables.conf
3133

@@ -38,6 +40,14 @@ source = $XDG_DATA_HOME/hypr/windowrules.conf
3840
#? Dynamic Stuff example theming and variable handlings
3941
source = $XDG_DATA_HOME/hypr/dynamic.conf
4042

43+
# hyprlang endif
44+
45+
# hyprlang if SCREEN_SHADER_COMPILED
46+
decoration:screen_shader = $SCREEN_SHADER_COMPILED #! This is the compiled shader file, it will be created by the shaders.sh script
47+
# hyprlang endif
48+
49+
# hyprlang if !CONFIG_ALREADY_LOADED
50+
4151
#? HyDE's startup overridable too!
4252
source = $XDG_DATA_HOME/hypr/startup.conf
4353

@@ -51,3 +61,5 @@ source = $XDG_CONFIG_HOME/hypr/workflows.conf
5161
source = $XDG_DATA_HOME/hypr/finale.conf
5262

5363
# hyprlang endif
64+
65+

Configs/.local/share/hypr/dynamic.conf

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ source = $XDG_CONFIG_HOME/hypr/shaders.conf # source shader variables
3030
source = $XDG_CONFIG_HOME/hypr/hyde.conf # Fallback if they still use hyde.conf
3131
source = $XDG_STATE_HOME/hyde/hyprland.conf # translated from config.toml // should override everything!
3232

33-
# hyprlang if SCREEN_SHADER_COMPILED
34-
decoration:screen_shader = $SCREEN_SHADER_COMPILED #! This is the compiled shader file, it will be created by the shaders.sh script
35-
# hyprlang endif
3633

3734
# hyprlang noerror false
3835
#! Below this is an immutable part of the configuration file, and should not be modified by the user.

Configs/.local/share/hypr/hyprland.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ source = ./env.conf
3030
#? Dynamic Stuff example theming and variable handlings
3131
source = ./dynamic.conf
3232

33+
# hyprlang if SCREEN_SHADER_COMPILED
34+
decoration:screen_shader = $SCREEN_SHADER_COMPILED #! This is the compiled shader file, it will be created by the shaders.sh script
35+
# hyprlang endif
36+
3337
#? HyDE's startup overridable too!
3438
source = ./startup.conf
3539

Configs/.local/share/hypr/variables.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ $start.XDG_PORTAL_RESET=hyde-shell resetxdgportal.sh
2424

2525
$start.AUTH_DIALOGUE=hyde-shell app -t service polkitkdeauth.sh
2626

27-
$start.BAR=hyde-shell app -t service waybar.py --watch
28-
$start.WALLPAPER=hyde-shell app -t service wallpaper.sh --start --global
27+
$start.BAR=hyde-shell app -u hyde-bar.scope -- waybar.py --watch
28+
$start.WALLPAPER=hyde-shell app -u hyde-wallpaper.scope -- wallpaper.sh --start --global
2929
$start.NOTIFICATIONS=hyde-shell app -t service dunst
3030

3131
$start.TEXT_CLIPBOARD=hyde-shell app -t service wl-paste --type text --watch cliphist store

0 commit comments

Comments
 (0)