about summary refs log tree commit diff
path: root/.local/bin/rofi-powermenu
diff options
context:
space:
mode:
authorvenomade <venomade@venomade.com>2026-02-16 17:31:16 +0000
committervenomade <venomade@venomade.com>2026-02-16 17:31:16 +0000
commita568a964fd6a9efba388b2b4919339c0b7dfe51d (patch)
tree0c6adbf753de1c0b469e911668a82c6b2002f5f8 /.local/bin/rofi-powermenu
parent9d2c3f898a97de16b986d4e494f31e6c6f3d176a (diff)
MacOS Nix HEAD master
Asahi is just not perfectly usable yet.
Moved stuff, went nix.
Diffstat (limited to '.local/bin/rofi-powermenu')
-rwxr-xr-x.local/bin/rofi-powermenu49
1 files changed, 0 insertions, 49 deletions
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