okraits / j4-make-config

Universal theme switcher and config generator for the i3 wm
http://www.okraits.de/index.php?section=projects&page=j4-make-config
185 stars 22 forks source link

Bugfix: Fix minor annoyance when commenting out bar section #12

Closed lasers closed 6 years ago

lasers commented 7 years ago

I run into this bug occasionally only when I want to change the number of bars on my monitors. When I want to use one bar instead of two, I will comment out a bar section like this...

# bar {
#    # $i3-theme-bar
#    workspace_buttons no
#    tray_output none
# }

I have to modify # $i3-theme-* slightly (such as omitting $) to stop receiving i3-nagbar about broken config on i3 restart. Here, we make sure it's only one # + $i3-theme-window on the line.

I suppose this can break some user's config if they have existing comments that does not follow your README such as ## $i3-theme-window, # $i3-theme-window #, etc.

Let me know if you want to do something slightly different. Thanks.

okraits commented 7 years ago

Personally I would prefer to check if the corresponding lines begin with the exact string as it is mentioned in the README, like this:

if line.startswith("# $i3-theme-window"):

As you mentioned, this would break user configs if they didn't use the exact markers as mentioned in the README. I don't see another solution though.

lasers commented 7 years ago

Here you go, sir. EDIT: Ran into a different issue, I think. Hold.

okraits commented 6 years ago

Merged in https://github.com/okraits/j4-make-config/commit/43a7acf579d84836b35363e1ebdd3fb061e4f531.

Thank you!