Skip to content

Commit

Permalink
add icons for lowpowermode
Browse files Browse the repository at this point in the history
  • Loading branch information
bin101 committed Oct 18, 2024
1 parent 5dcd700 commit 3bfd5f6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions config/sketchybar/icons.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ local icons = {
gear = "􀍟",
cpu = "􀫥",
clipboard = "􀉄",
slow = "􀓑",
fast = "􀓏",
error = "􀆚",

switch = {
on = "􁏮",
Expand Down
7 changes: 4 additions & 3 deletions config/sketchybar/items/widgets/lowpowermode.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
local colors = require("colors")
local icons = require("icons")
local settings = require("settings")

local label = "?"
local label = icons.error
local color = colors.orange
local modeValue = 0

Expand All @@ -28,11 +29,11 @@ local lowpowermodebracket = sbar.add("bracket", "widgets.lowpowermode.bracket",
local function setModeValue(v)
modeValue = v
if v == 1 then
label = "L"
label = icons.slow
color = colors.green
sbar.exec("sudo pmset -a lowpowermode 1")
else
label = "P"
label = icons.fast
color = colors.red
sbar.exec("sudo pmset -a lowpowermode 0")
end
Expand Down

0 comments on commit 3bfd5f6

Please sign in to comment.