From a568a964fd6a9efba388b2b4919339c0b7dfe51d Mon Sep 17 00:00:00 2001 From: venomade Date: Mon, 16 Feb 2026 17:31:16 +0000 Subject: MacOS Nix Asahi is just not perfectly usable yet. Moved stuff, went nix. --- .local/bin/rofi-powermenu | 49 ----------------------------------------------- 1 file changed, 49 deletions(-) delete mode 100755 .local/bin/rofi-powermenu (limited to '.local/bin/rofi-powermenu') diff --git a/.local/bin/rofi-powermenu b/.local/bin/rofi-powermenu deleted file mode 100755 index 0ff3f9c..0000000 --- a/.local/bin/rofi-powermenu +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env lua - -local function rofi(prompt, lines) - local cmd = string.format( - 'printf "%s" | rofi -dmenu -i -p "%s"', - table.concat(lines, "\n"), - prompt - ) - local handle = io.popen(cmd) - local selection = handle:read("*a") - handle:close() - selection = selection:gsub("%s+$", "") - if selection == "" then return nil end - return selection -end - -local function contains(tbl, val) - for _, v in pairs(tbl) do - if v == val then - return true - end - end - return false -end - --- TODO: Deduplicate This -local options = { - "Log Out", - "Shutdown", - "Restart" -} - -local option_pair = { - ["Log Out"] = "swaymsg exit", - ["Shutdown"] = "systemctl poweroff", - ["Restart"] = "systemctl reboot" -} - -local choice = rofi("Action:", options) -if (not choice) or (not contains(options,choice)) then os.exit() end - -if choice == "Log Out" then - io.popen(option_pair[choice]) -else - local confirm = rofi("Are you sure?:", {"Yes", "No"}) - if confirm == "Yes" then - io.popen(option_pair[choice]) - end -end -- cgit 1.4.1-2-gfad0