Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limited number of modules #31

Open
ChouangTseu opened this issue May 13, 2018 · 3 comments
Open

Limited number of modules #31

ChouangTseu opened this issue May 13, 2018 · 3 comments

Comments

@ChouangTseu
Copy link

Hello unix121,
first of all, thank you for your work; I like what you did.
I successfully installed everything on my machine, and it seems to be working well in general. However, I would like to have more than 4 modules with polybar. Currently it shows: the wifi; the workspace numbers; the time/date; the power button. I would like to add cpu & memory usage, battery status, xkeyboard, and volume.
Modifying the polybar config file, I tried to add a few modules, but they do not appear on the bar on restart. I guess it has something to do with the parameters in the section [bar/i3wmthemer_bar]? Or do I have to change some other config file in the /i3wm-themer folder?
Here is my polybar config file:

[bar/i3wmthemer_bar]
width = 100%
height = 27
radius = 0
fixed-center = false

background = #1d1f21
foreground = #c5c8c6

line-size = 3
line-color =

border-size = 0
border-color =

padding-left = 0
padding-right = 2

module-margin-left = 1
module-margin-right = 2

font-0 = "Source Code Pro Semibold:pixelsize=10;1"
font-1 = "Font Awesome 5 Free:style=Solid:pixelsize=10;1"
font-2 = "Font Awesome 5 Brands:pixelsize=10;1"

modules-left = wlan eth
modules-center = i3
modules-right = date powermenu

tray-position =
;tray-padding =

cursor-click = pointer
cursor-scroll = ns-resize

[module/i3]
type = internal/i3
format = <label-state> <label-mode>
index-sort = true
wrapping-scroll = false

label-mode-padding = 2
label-mode-foreground = #282a2e
label-mode-background = #1d1f21

label-focused = %index%
label-focused-background = #5f819d
label-focused-foreground = #1d1f21
label-focused-padding = 2

label-unfocused = %index%
label-unfocused-background = #81a2be
label-unfocused-foreground = #1d1f21
label-unfocused-padding = 2

label-visible = %index%
label-visible-background = #81a2be
label-visible-foreground = #1d1f21
label-visible-padding = 2

label-urgent = %index%
label-urgent-background = #BA2922
label-urgent-padding = 2

[module/wlan]
type = internal/network
interface = wlp3s0
interval = 3.0

format-connected = <ramp-signal> <label-connected>
format-connected-foreground = #1d1f21
format-connected-background = #81a2be
format-connected-padding = 2
label-connected = %essid%

format-disconnected =

ramp-signal-0 = 
ramp-signal-1 = 
ramp-signal-2 = 
ramp-signal-3 = 
ramp-signal-4 = 
ramp-signal-foreground = #1d1f21

; Test connectivity every Nth update
; A value of 0 disables the feature
; NOTE: Experimental (needs more testing)
; Default: 0
;ping-interval = 3

; @deprecated: Define min width using token specifiers (%downspeed:min% and %upspeed:min%)
; Minimum output width of upload/download rate
; Default: 3
udspeed-minwidth = 5

; Accumulate values from all interfaces
; when querying for up/downspeed rate
; Default: false
accumulate-stats = true

; Consider an `UNKNOWN` interface state as up.
; Some devices have an unknown state, even when they're running
; Default: false
unknown-as-up = true

[module/eth]
type = internal/network
interface = enp2s0f1
interval = 3.0

format-connected-padding = 2
format-connected-foreground = #1d1f21
format-connected-background = #81a2be
format-connected-prefix = " "
format-connected-prefix-foreground = #1d1f21
label-connected = %local_ip%

format-disconnected =

[module/date]
type = internal/date
interval = 5

date =
date-alt = " %Y-%m-%d"

time = %H:%M
time-alt = %H:%M:%S

format-prefix = 
format-foreground = #1d1f21
format-background = #81a2be
format-padding = 2

label = %date% %time%

[module/powermenu]
type = custom/menu

expand-right = true

format-spacing = 1

label-open = 
label-open-foreground = #81a2be
label-close =  cancel
label-close-foreground = #81a2be
label-separator = |
label-separator-foreground = #81a2be

menu-0-0 = reboot
menu-0-0-exec = menu-open-1
menu-0-1 = power off
menu-0-1-exec = menu-open-2

menu-1-0 = cancel
menu-1-0-exec = menu-open-0
menu-1-1 = reboot
menu-1-1-exec = sudo reboot

menu-2-0 = power off
menu-2-0-exec = sudo poweroff
menu-2-1 = cancel
menu-2-1-exec = menu-open-0

[settings]
screenchange-reload = true

[global/wm]
margin-top = 0
margin-bottom = 0

[module/battery]
type = internal/battery

; This is useful in case the battery never reports 100% charge
full-at = 99

; Use the following command to list batteries and adapters:
; $ ls -1 /sys/class/power_supply/
battery = BAT1
adapter = ACAD

; If an inotify event haven't been reported in this many
; seconds, manually poll for new values.
;
; Needed as a fallback for systems that don't report events
; on sysfs/procfs.
;
; Disable polling by setting the interval to 0.
;
; Default: 5
poll-interval = 5

; see "man date" for details on how to format the time string
; NOTE: if you want to use syntax tags here you need to use %%{...}
; Default: %H:%M:%S
;time-format = %H:%M

; Available tags:
;   <label-charging> (default)
;   <bar-capacity>
;   <ramp-capacity>
;   <animation-charging>
format-charging = <animation-charging> <label-charging>

; Available tags:
;   <label-discharging> (default)
;   <bar-capacity>
;   <ramp-capacity>
;   <animation-discharging>
format-discharging = <ramp-capacity> <label-discharging>

; Available tags:
;   <label-full> (default)
;   <bar-capacity>
;   <ramp-capacity>
;format-full = <ramp-capacity> <label-full>

; Available tokens:
;   %percentage% (default)
;   %time%
;   %consumption% (shows current charge rate in watts)
label-charging = Charging %percentage%%

; Available tokens:
;   %percentage% (default)
;   %time%
;   %consumption% (shows current discharge rate in watts)
label-discharging = Discharging %percentage%%

; Available tokens:
;   %percentage% (default)
label-full = Fully charged

; Only applies if <ramp-capacity> is used
ramp-capacity-0 = 
ramp-capacity-1 = 
ramp-capacity-2 = 
ramp-capacity-3 = 
ramp-capacity-4 = 

; Only applies if <bar-capacity> is used
bar-capacity-width = 10

; Only applies if <animation-charging> is used
animation-charging-0 = 
animation-charging-1 = 
animation-charging-2 = 
animation-charging-3 = 
animation-charging-4 = 
; Framerate in milliseconds
animation-charging-framerate = 750

; Only applies if <animation-discharging> is used
animation-discharging-0 = 
animation-discharging-1 = 
animation-discharging-2 = 
animation-discharging-3 = 
animation-discharging-4 = 
; Framerate in milliseconds
animation-discharging-framerate = 500

[module/cpu]
type = internal/cpu

; Seconds to sleep between updates
; Default: 1
interval = 0.5

; Available tags:
;   <label> (default)
;   <bar-load>
;   <ramp-load>
;   <ramp-coreload>
format = <label> <ramp-coreload>

; Available tokens:
;   %percentage% (default) - total cpu load
;   %percentage-cores% - load percentage for each core
;   %percentage-core[1-9]% - load percentage for specific core
label = CPU %percentage%%

ramp-coreload-0 = ▁
ramp-coreload-1 = ▂
ramp-coreload-2 = ▃
ramp-coreload-3 = ▄
ramp-coreload-4 = ▅
ramp-coreload-5 = ▆
ramp-coreload-6 = ▇
ramp-coreload-7 = █

My system:
Kernel: 4.9.98-1-MANJARO x86_64 bits: 64 compiler: gcc v: 7.3.1 Desktop: i3 4.15.0.1 Distro: Manjaro Linux 17.1.10 Hakoila Machine: Type: Laptop System: Acer product: Aspire A515-51G

I would appreciate if you could help me out.

@stav121
Copy link
Owner

stav121 commented May 13, 2018

Hello sir,
All you have to do is change those lines:

modules-left = wlan eth
modules-center = i3
modules-right = date powermenu

to:

modules-left = wlan eth
modules-center = i3
modules-right = battery cpu date powermenu

Reading the documentation of 'Polybar' would help you.

@ChouangTseu
Copy link
Author

Thank you. Adding modules to the lines you mentioned does the trick... as long as I don't switch the theme. Whenever I switch, the added modules disappear from the config files, meaning that the lines revert back to the default:

modules-left = wlan eth
modules-center = i3
modules-right = date powermenu

How could I keep the polybar config file intact when changing a theme?

I don't know if it's of any importance for the question, but since I installed the themer, most of the Fn keys do not respond anymore; also the alternative keyboard layouts I had configured seem to be inaccessible via my usual Alt+Shift shortcut.

@stav121
Copy link
Owner

stav121 commented May 18, 2018

Hello again sir.

I've thought of a way to fix this issue by adding tags to the lines that must be changed through the there. It needs a bit of work but I might be able to pull it out some time soon.

About the Fn thing, most of those keys are configured inside your ~/.i3/config file, so if you have saved a backup of your original config file, just go in there and copy-paste them into your new ones.

There are a few resources you could read:
https://faq.i3wm.org/question/125/how-to-change-the-systems-volume.1.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants