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

Variable for module titles in modeline? #222

Open
chuchana opened this issue Apr 5, 2021 · 2 comments
Open

Variable for module titles in modeline? #222

chuchana opened this issue Apr 5, 2021 · 2 comments

Comments

@chuchana
Copy link

chuchana commented Apr 5, 2021

What do you think about setting the titles of the modules in a variable, e.g. (defvar *cpu-title* "CPU: ")?

That would make it easy to customize them in the stumpwm init files, e.g. with a unicode symbol, or removing them completely. Or automatically renaming the network interface, e.g. from something like wlp3s0 to wifi.

@Phundrak
Copy link

Regarding the cpu module, you can modify the cpu::*cpu-usage-modeline-fmt* variable. For instance,

(setf cpu::*cpu-usage-modeline-fmt* "^[~A~3D%^]")

will only display the output of cpu::*cpu-modeline-fmt* with some padding.


If you wish to modify the formatters for the net module, you can use net::*net-formatters-alist* like so:

(pushnew '(#\D device-type) net::*net-formatters-alist*)

and write your own device-type function that determines the type of the interface and returns it. Take a look at the function net-device in the module for inspiration.


Reading the source code of the modules can solve a lot of these issues.

@heiwiper
Copy link

The method mentioned by Phundrak works, this issue should be closed I think.

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

3 participants