Skip to content

Commit 7831447

Browse files
committed
Use battery for laptop env only.
1 parent ce0905f commit 7831447

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

themes/multicolor/theme.lua

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ local dsconfig = dsession.load_display_session()
5353
dsconfig.theme = theme
5454
dsconfig.theme_name = theme_name
5555
dsconfig.isFullhd = scr_res == "1920x1080+0+0"
56+
dsconfig.isLaptop = os.getenv("LAPTOP")
5657
theme.dsconfig = dsconfig
5758
-- }}}
5859

@@ -405,6 +406,11 @@ local spotifyWibox = spotify_widget({
405406
pause_icon = '/usr/share/icons/Papirus-Dark/24x24/panel/spotify-indicator.svg'
406407
})
407408

409+
-- Battery widget
410+
local battery = nil
411+
if dsconfig.isLaptop then
412+
battery = battery_widget({ display_notification = true, show_current_level = true, margin_right = 10 })
413+
end
408414
-- Systray
409415
local systray = wibox.widget.systray()
410416
systray.base_size = theme.bar_height
@@ -467,12 +473,6 @@ local mylauncher = awful.widget.launcher({
467473
})
468474
-- }}}
469475

470-
-- configure just once for 1st screeen
471-
local onlyOnce = function(func, s)
472-
if s.index == 1 then
473-
func()
474-
end
475-
end
476476

477477
-------------------------------------
478478
-- DESKTOP and PANELS CONFIGURATION
@@ -544,7 +544,7 @@ capi.screen.connect_signal("request::desktop_decoration", function(s)
544544
separator,
545545
todo_widget(),
546546
separator,
547-
battery_widget({ display_notification = true, show_current_level = true, margin_right = 10 }),
547+
battery,
548548
systray,
549549
separator,
550550
archupdateWibox,

0 commit comments

Comments
 (0)