From bc0d3a7737f2b7cbfbce6ea690322215e2993c67 Mon Sep 17 00:00:00 2001 From: Jeena Date: Sat, 13 Dec 2025 14:14:04 +0900 Subject: [PATCH 1/2] Add xdg-desktop-portal-hyprland as dependency Also to start it, for some reason it needs to be killed and there needs to be a sleep, etc. to avoid some race conditions. Therefor I added this weird shell script to start it. --- README.md | 2 ++ hypr/hyprland.conf | 1 + hypr/scripts/xdg-desktop-portal-hyprland.sh | 8 ++++++++ 3 files changed, 11 insertions(+) create mode 100755 hypr/scripts/xdg-desktop-portal-hyprland.sh diff --git a/README.md b/README.md index fda6063..c3db46f 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,8 @@ You also need to install all the dependencies: - Curved Square font https://www.1001freefonts.com/curved-square.font - FontAwesome - JetBrainsMono Font +- xdg-desktop-portal-hyprland +- xdg-desktop-portal-gtk There are probably more, I will update the list next time I'm installing it on a new computer. diff --git a/hypr/hyprland.conf b/hypr/hyprland.conf index 01c9921..1622cfe 100644 --- a/hypr/hyprland.conf +++ b/hypr/hyprland.conf @@ -43,6 +43,7 @@ exec-once = hypridle exec-once = waybar exec-once = swaybg -i ~/.config/hypr/wallpapers/Purple.jpg -m fill exec-once = ~/.config/hypr/scripts/dynamic-borders.sh +exec-once = ~/.config/hypr/scripts/xdg-desktop-portal-hyprland.sh source = ~/.config/hypr/autostart.conf diff --git a/hypr/scripts/xdg-desktop-portal-hyprland.sh b/hypr/scripts/xdg-desktop-portal-hyprland.sh new file mode 100755 index 0000000..a1ea640 --- /dev/null +++ b/hypr/scripts/xdg-desktop-portal-hyprland.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +sleep 1 +killall -e xdg-desktop-portal-hyprland +killall xdg-desktop-portal +/usr/lib/xdg-desktop-portal-hyprland & +sleep 2 +/usr/lib/xdg-desktop-portal & From de7375bfb7d08017fdb664c8b7312843b32e45c1 Mon Sep 17 00:00:00 2001 From: Jeena Date: Sat, 13 Dec 2025 14:27:09 +0900 Subject: [PATCH 2/2] Add idle-inhibit Sometimes I don't want the computer to go to sleep bacause I'm running something in the background. for that I always used systemd-inhibit sleep 999999 manually on the terminal, but I want it to be easy to use without remembering the whole command every time. Therefor I added a custom button to waybar which does that for me. --- hypr/scripts/idle-inhibit-toggle.sh | 13 +++++++++++++ waybar/config | 10 ++++++++++ waybar/style.css | 3 ++- 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100755 hypr/scripts/idle-inhibit-toggle.sh diff --git a/hypr/scripts/idle-inhibit-toggle.sh b/hypr/scripts/idle-inhibit-toggle.sh new file mode 100755 index 0000000..fbebdbf --- /dev/null +++ b/hypr/scripts/idle-inhibit-toggle.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +PIDFILE="$XDG_RUNTIME_DIR/idle-inhibit.pid" + +if [[ -f "$PIDFILE" ]] && kill -0 "$(cat "$PIDFILE")" 2>/dev/null; then + kill "$(cat "$PIDFILE")" + rm -f "$PIDFILE" + echo "off" +else + systemd-inhibit --what=idle:sleep --why="Manual Waybar inhibit" sleep infinity & + echo $! > "$PIDFILE" + echo "on" +fi diff --git a/waybar/config b/waybar/config index 7b6c580..6fdc45f 100644 --- a/waybar/config +++ b/waybar/config @@ -15,6 +15,7 @@ "network", "hyprland/language", "custom/notifications", + "custom/idle-inhibit", "custom/power" ], @@ -100,6 +101,15 @@ "escape": true }, + "custom/idle-inhibit": { + "exec": "if test -f $XDG_RUNTIME_DIR/idle-inhibit.pid; then echo '󰅶'; else echo '󰾪'; fi", + "on-click": "~/.config/hypr/scripts/idle-inhibit-toggle.sh", + "interval": 2, + "return-type": "raw", + "tooltip": true, + "tooltip-format": "Idle inhibit" + }, + "custom/power": { "format": " ⏻ ", "tooltip": false, diff --git a/waybar/style.css b/waybar/style.css index 9455541..875f8b3 100644 --- a/waybar/style.css +++ b/waybar/style.css @@ -81,7 +81,8 @@ window#waybar { #window, #custom-power, #language, -#mpd { +#mpd, +#custom-idle-inhibit { margin: 8px 2px; padding: 0 18px 0 18px; color: black;