budlabs / mondo Goto Github PK
View Code? Open in Web Editor NEWA theme manager and generator written in bash
License: MIT License
A theme manager and generator written in bash
License: MIT License
Hello BudRich,
I would like to thank you for all your work around i3-wm tiling and ricing, it really makes it seem easier to do and save from hours of research and testing.
I decided today to use your mondo tool to manage themes in my i3-wm.
I started following your videos tutorials and created a theme as you suggested without parsing any file to it just a simple command:
mondo -n mytheme
If this would have worked like you stated in your video I would have some mondo resources defined in it right? Like that:
#define fg #bdae93
#define bg #252323
#define base00 #252323
#define base01 #8f3f71
#define base02 #427b58
#define base03 #32302F
#define base0 #b57614
#define base1 #bdae93
#define base2 #ebdbb2
#define base3 #f9f5d7
#define red #cc241d
#define ora #9d0006
#define grn #98971a
#define ylw #d79921
#define blu #458588
#define mag #b16286
#define vio #076678
#define cyn #689d6a
mondo.colors.fg1: fg
mondo.colors.fg2: base2
mondo.colors.bg1: bg
mondo.colors.bg2: base03
mondo.colors.dark1: base00
mondo.colors.light1: base3
mondo.colors.act1: blu
mondo.colors.act2: base3
mondo.colors.act3: base00
mondo.colors.ina1: base03
mondo.colors.ina2: fg
mondo.colors.ina3: base2
mondo.colors.sel1: base00
mondo.colors.sel2: base3
!! GUI theme
#define cursortheme Adwaita
#define icontheme ePapirus
#define gtktheme buddybud
!! Terminal fonts
#define terminalfontface1 monospace
#define terminalfontsize1 12
#define terminalfontface2 monospace
#define terminalfontsize2 18
!! GUI fonts
#define guifontface1 monospace
#define guifontsize1 12
#define guifontface2 sans
#define guifontsize2 18
Because it takes kind of inspiration from Xresources by default (also nitce my .Xresources file looks exactly like yours in your tutorials, importing colors and urxvt file).
So my theme file looks like this:
!! Theme: mytheme
!! Author: dreamer
!! Created: 2018-08-30
bg #222222
bg2 #333333
fg #DDDDDD
comment #AAAAAA
red #FF0000
green #00FF00
blue #0000FF
yellow #FFFF00
cyan #00FFFF
magenta #FF00FF
dark #000000
light #FFFFFF
activebg cyan
activefg light
activehl dark
inactivebg blue
inactivefg fg
selectedbg magenta
selectedfg light
It produces something similar to this even if I parse an Xresources type file from the unixporn contest you linked up in your video. But by reading the README of the latest mondo version I found out that the synopsis for creating a new theme has changed like you can't parse a file anymore? Just a name?
I watched your videos multiple times to find where I could have done something wrong but I don't find my error maybe something changed in newer mondo versions? I also output my xrdb resources and everything is fine on this part. I'm really stuck and dont know how to solve this...
Thank you for reading,
Hope you can give me a hand,
Thanks :)
I'm not sure if this is intended or not but it took me a stupidly long while to figure out what was wrong because I wasn't looking for it lol. Anyways, dashes '-' and underscores '_' set empty values when generated. I'm sure there is more but thought I'd just throw this out there.
Linux jason 5.3.12-arch1-1 #1 SMP PREEMPT Wed, 20 Nov 2019 19:45:16 +0000 x86_64 GNU/Linux
mondo -v
mondo - version: 2019.02.20.5
updated: 2019-02-20 by budRich
i3 version 4.17.1 (2019-08-30) 2009 Michael Stapelberg and contributors
I'm trying to create a theme but it returns a null value
watch this video https://streamable.com/pnaaw
every time I update a config file (say polybar's), I also have to update polybar's _mondo-template, otherwise when the former gets overwritten when I apply a theme, it'll be outdated by an edit. This updating gets a little tedious, especially when you got 4 or 5 other generators.
I thought it'd be a good idea to maybe have __mondo-template contain only lines from the original config that require substitution, so like for polybar:
~/.config/mondo/generators/polybar/_mondo-template
background = %%activebg%%
background-alt = %%inactivebg%%
foreground = %%activefg%%
foreground-alt = %%inactivefg%%
primary = %%blue%%
secondary = %%yellow%%
alert = %%red%%
That way, whenever we update the original polybar config, we don't need to update the polybar _mondo-template. And to apply the theme, we'd just need to update the original config with the generated theme files instead of overwriting the entire original config. The only problem is I don't know how to do that just yet. I think diff could help but the real problem is how to replace the appropriate lines in the original config file.
I saw that your mondo-contrib repo was structured like this so I have no idea if this is already a feature? If it is, it hasn't worked for me so far (though maybe I'm just being dumb and messing up) so thought I'd just bring it up.
This only occurs when the last line in your theme file is a variable (from what I noticed). I noticed this when I hadn't added in
! syntax:ssExcla
at the end of my file. For example, this was my theme file:
!! Theme: wheat
!! Author: cush
!! Created: 2019-02-27
...
...
...
accent blu
altAccent blu3
bg blk2
altBg grey
fg wht2
altFg blu2
alt2Fg wht3
cursor wht3
altCursor blu
primaryFont monospace
And when I looked in my i3 config, this was happening
font pango:monospacegtktheme 12
gtktheme was the first line in my default theme file. So I then just deleted everything in that file and then I got:
font pango:monospace!! Theme: wheat 12
I then tried adding a fake variable at the end of my file and this issue went away. I can't reproduct the issue once I fixed it though. So not sure but figured I'd let you know.
Hello.
Am I correct that it is not allowed to have values with whitespaces in my theme file?
For example:
MONDO_DIR\themes\mytheme
:
myvar "hello world"
if I do mondo -l vars mytheme
it only parses the "hello
part of the value. Can this be fixed?
Hello BudRich,
Sorry to disturb you, I decided to use the old version of mondo you used in your videos because it's easier to at the moment and when I ran the script mondo I got this error:
mondo: line 291: syntax error near unexpected token
('
mondo: line 291: cat "$src" "$MONDO_DIR/mondo-init" <(genxcolors "$src") \'
Do you know how I can solve it or if you can?
Thanks :)
After a clean install, my $XDG_CONFIG_HOME
is unset so the $MONDO_DIR
variable gets set to /mondo which obviously messes things up a bit.
Apparently $XDG_CONFIG_HOME
isn't set automatically? I thought it was... Maybe I did something wrong...
Anyways, maybe a check should be put in like XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-${HOME}/.config}"
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.