about summary refs log tree commit diff
path: root/.local/bin/rofi-ppd
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-ppd
parent9d2c3f898a97de16b986d4e494f31e6c6f3d176a (diff)
MacOS Nix HEAD master
Asahi is just not perfectly usable yet.
Moved stuff, went nix.
Diffstat (limited to '.local/bin/rofi-ppd')
-rwxr-xr-x.local/bin/rofi-ppd48
1 files changed, 0 insertions, 48 deletions
diff --git a/.local/bin/rofi-ppd b/.local/bin/rofi-ppd
deleted file mode 100755
index 5a4f13b..0000000
--- a/.local/bin/rofi-ppd
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/usr/bin/env lua
-
-local function trim(s)
-  return s:gsub("^%s+", ""):gsub("%s+$", "")
-end
-
-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 = trim(selection or "")
-  if selection == "" then return nil end
-  return selection
-end
-
-local modes = {}
-
-local handle = io.popen('powerprofilesctl list')
-local profile_list = handle:read("*a")
-handle:close()
-
-local handle = io.popen('powerprofilesctl get')
-local current_profile = trim(handle:read("*a") or "")
-handle:close()
-
-for line in profile_list:gmatch("[^\r\n]+") do
-  line = trim(line)
-  local mode = line:match("^%*?%s*([%w%-_]+)%s*:$")
-  if mode then
-    if mode == current_profile then
-      table.insert(modes, "* " .. mode)
-    else
-      table.insert(modes, "  " .. mode)
-    end
-  end
-end
-
-local selected_profile = rofi('󰓅', modes)
-if not selected_profile then os.exit() end
-
-selected_profile = selected_profile:gsub("^%*%s*", ""):gsub("^%s+", "")
-
-io.popen('powerprofilesctl set ' .. selected_profile)