linkfrg / dotfiles

My Hyprland dotfiles
498 stars 17 forks source link

please add battery icon in systray #2

Closed Vikash-Singh-Tanwar closed 8 months ago

linkfrg commented 8 months ago

I don’t understand a little, the tray is already there and the battery icon will be there. You may need to open a tray window(press button with arrow in bar) and restart cbatticon or something like this

Vikash-Singh-Tanwar commented 8 months ago

I mean I've got a laptop and there is no battery indicator in bar if possible can you add it I mean in

Vikash-Singh-Tanwar commented 8 months ago

Screenshot_2023-11-03-21-16-01-57_320a9a695de7cdce83ed5281148d6f19.jpg

Vikash-Singh-Tanwar commented 8 months ago

Add it somewhere in thier

linkfrg commented 8 months ago

I don't have laptop so i can't test it, You can add it yourself in modules/indicator.yuck

Vikash-Singh-Tanwar commented 8 months ago

Can you guide how to I'll do it then I am a newbe in this kind of stuff if you explain keeping that in mind I'll be much more thankfull

A31Nesta commented 8 months ago

I added the battery indicator for my laptop. I edited indicator.yuck inside the modules folder.

At the bottom of the file I added:

(defwidget battery_icon []
    (state_icon :condition true
                :text {EWW_BATTERY.BAT1.capacity > 90 ? " " : EWW_BATTERY.BAT1.capacity > 75 ? " " : EWW_BATTERY.BAT1.capacity > 50 ? " " : EWW_BATTERY.BAT1.capacity > 25 ? " " : " "}
    )
)

and then at the top of the file I added my battery_icon to the indicator like this:

(defwidget indicator []
    (button :onclick "scripts/toggle_control_center.sh" :class "indicator"
        (box :orientation "h" :space-evenly false
            (recorder_icon)
            (network_icon)
            (do-not-disturb_icon)
            (theme_icon)
            (volume_icon)
            (battery_icon)
            (clock)
        )
    )
)
Vikash-Singh-Tanwar commented 8 months ago

Thank you bro you are a life saver

linkfrg commented 8 months ago

if battery icon is still not showing, replace BAT0 in (battery_icon) widget in indicator.yuck by battery name from eww get EWW_BATTERY

Vikash-Singh-Tanwar commented 8 months ago

It is visible thanks