Renamed hyprland folder in /usr/share to hypr to override default hyprland configs
All checks were successful
bluebuild / Build Custom Image (recipe.yml) (push) Successful in 57s
All checks were successful
bluebuild / Build Custom Image (recipe.yml) (push) Successful in 57s
This commit is contained in:
18
files/system/usr/share/hypr/scripts/hypr_power/hypr_close_clients
Executable file
18
files/system/usr/share/hypr/scripts/hypr_power/hypr_close_clients
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
HYPRCMDS=$(hyprctl -j clients | jq -j '.[] | "dispatch closewindow address:\(.address); "')
|
||||
hyprctl --batch "$HYPRCMDS" >>/tmp/hyprexitwithgrace.log 2>&1
|
||||
|
||||
notify-send "power controls" "Closing Applications..."
|
||||
|
||||
sleep 2
|
||||
|
||||
COUNT=$(hyprctl clients | grep "class:" | wc -l)
|
||||
|
||||
if [ "$COUNT" -eq "0" ]; then
|
||||
notify-send "power controls" "Closed Applications."
|
||||
return
|
||||
else
|
||||
notify-send "power controls" "Some apps didn't close. Not shutting down."
|
||||
exit 1
|
||||
fi
|
5
files/system/usr/share/hypr/scripts/hypr_power/hypr_logout
Executable file
5
files/system/usr/share/hypr/scripts/hypr_power/hypr_logout
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
/usr/share/hypr/scripts/hypr_power/hypr_close_clients
|
||||
|
||||
hyprctl dispatch exit
|
5
files/system/usr/share/hypr/scripts/hypr_power/hypr_reboot
Executable file
5
files/system/usr/share/hypr/scripts/hypr_power/hypr_reboot
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
/usr/share/hypr/scripts/hypr_power/hypr_close_clients
|
||||
|
||||
systemctl reboot
|
5
files/system/usr/share/hypr/scripts/hypr_power/hypr_shutdown
Executable file
5
files/system/usr/share/hypr/scripts/hypr_power/hypr_shutdown
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
/usr/share/hypr/scripts/hypr_power/hypr_close_clients
|
||||
|
||||
systemctl poweroff
|
3
files/system/usr/share/hypr/scripts/load-kwallet-apps.sh
Executable file
3
files/system/usr/share/hypr/scripts/load-kwallet-apps.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
# nextcloud desktop
|
||||
sleep 15 && flatpak run --branch=stable --arch=x86_64 --command=nextcloud --file-forwarding com.nextcloud.desktopclient.nextcloud
|
5
files/system/usr/share/hypr/scripts/load-kwallet.sh
Executable file
5
files/system/usr/share/hypr/scripts/load-kwallet.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
kwalletmanager5 &
|
||||
sleep 1 && exec --no-startup-id /usr/lib/pam_kwallet_init
|
||||
notify-send -e --expire-time=2000 'Kwallet has been loaded. Loading dependent apps...'
|
||||
sleep 2 && hyprctl dispatch closewindow class:org.kde.kwalletmanager
|
4
files/system/usr/share/hypr/scripts/local-lua
Executable file
4
files/system/usr/share/hypr/scripts/local-lua
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
BIN_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
|
||||
|
||||
LUA_PATH="${BIN_DIR}/?.lua;;" lua $1
|
27
files/system/usr/share/hypr/scripts/menu.lua
Normal file
27
files/system/usr/share/hypr/scripts/menu.lua
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env lua
|
||||
local menu = {}
|
||||
|
||||
function menu:clean_string(str)
|
||||
str = string.gsub(str, "^%s+", "")
|
||||
str = string.gsub(str, "%s+$", "")
|
||||
return string.gsub(str, "[\n]+", " ")
|
||||
end
|
||||
|
||||
function menu:bring_menu(prompt, options)
|
||||
local options_string = ""
|
||||
local length = 1
|
||||
for _, value in pairs(options) do
|
||||
options_string = options_string .. value .. "\n"
|
||||
length = length + 1
|
||||
end
|
||||
|
||||
options_string = options_string:sub(1, -2)
|
||||
|
||||
local command = "echo -e '" .. options_string .. "' | rofi -dmenu -i -p '" .. prompt .. "'"
|
||||
local f = assert(io.popen(command, "r"))
|
||||
local s = menu:clean_string(assert(f:read("*a")))
|
||||
f:close()
|
||||
return s
|
||||
end
|
||||
|
||||
return menu
|
14
files/system/usr/share/hypr/scripts/powermenu.lua
Normal file
14
files/system/usr/share/hypr/scripts/powermenu.lua
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env lua
|
||||
local menu = require("menu")
|
||||
local executable = {
|
||||
["Shutdown"] = "/usr/share/hyprland/scripts/hypr_power/hypr_shutdown",
|
||||
["Reboot"] = "/usr/share/hyprland/scripts/hypr_power/hypr_reboot",
|
||||
["Log out"] = "/usr/share/hyprland/scripts/hypr_power/hypr_logout",
|
||||
["Cancel"] = "",
|
||||
}
|
||||
|
||||
local options = { "Shutdown", "Reboot", "Log out", "Cancel" }
|
||||
|
||||
local s = menu:bring_menu("Power menu", options)
|
||||
|
||||
os.execute(executable[s])
|
Reference in New Issue
Block a user