Moved hyprland config to its own folder and created a session file specifically for hydro-os config hyprland.
All checks were successful
bluebuild / Build Custom Image (recipe.yml) (push) Successful in 23s
All checks were successful
bluebuild / Build Custom Image (recipe.yml) (push) Successful in 23s
This commit is contained in:
27
files/system/usr/share/hypr-hydro-os/scripts/menu.lua
Normal file
27
files/system/usr/share/hypr-hydro-os/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
|
Reference in New Issue
Block a user