Colorful tag patch
siduck opened this issue · 45 comments
Hi @fitrh , I have seen your post on imgur
here : https://imgur.com/t/linux_desktop/W7lQkXB
Can you share the colorful tag patch? Im currently using rainbow tags but feels ugly
The main implementation is here d139433 and later update is here 4e8cc1d, sorry for the dirty diff, i have a plan to release all my personal patch but i think i have to clear the diff first.
BTW, what you look at that screenshot is not only the colorful tag, there are colorful title, bar line indicator, and vacant tag patch
The main implementation is here d139433 and later update is here 4e8cc1d, sorry for the dirty diff, i have a plan to release all my personal patch but i think i have to clear the diff first.
BTW, what you look at that screenshot is not only the colorful tag, there are colorful title, bar line indicator, and vacant tag patch
Yeah I've seen your commits , however I want only colorful tags tho :)
Just use those 2 commits
Inside the drawbar
function, before you draw the tag, tag drawing look like this (i'm using alttag patch)
drw_text(drw, x, y,
w + y, h, wdelta + lrpad / 2,
(m->alttag ? tagsalt[i] : tags[i]),
urg & 1 << i);
Inside the
drawbar
function, before you draw the tag, tag drawing look like this (i'm using alttag patch)drw_text(drw, x, y, w + y, h, wdelta + lrpad / 2, (m->alttag ? tagsalt[i] : tags[i]), urg & 1 << i);
idk C ,you mean this function?
https://github.com/siduck76/chadwm/blob/main/chadwm/dwm.c#L1272
Inside the
drawbar
function, before you draw the tag, tag drawing look like this (i'm using alttag patch)drw_text(drw, x, y, w + y, h, wdelta + lrpad / 2, (m->alttag ? tagsalt[i] : tags[i]), urg & 1 << i);idk C ,you mean this function?
https://github.com/siduck76/chadwm/blob/main/chadwm/dwm.c#L1272
Yes, replace that line
@fitrh i tried adding it but i get colored icons only if the tag is active :/ or it just uses SchemeTag for the rest of that tags
I added the colorful patch only : siduck/chadwm@d1223ea
Ah, that's how it is work, only the selected tag is colored, what you see in my screenshot is when using all tag view mode (Mod-0 by default) a.k.a all the tags get selected.
Ff you want the tags colored all the time, remove the conditional checking and make it something like this
drw_setscheme(drw, tagschemes[i]);
```c drw_setscheme(drw, tagschemes[i]);
wouldnt it be better to color them only if they're occupied? :D
Ah, that's how it is work, only the selected tag is colored, what you see in my screenshot is when using all tag view mode (Mod-0 by default) a.k.a all the tags get selected.
Ff you want the tags colored all the time, remove the conditional checking and make it something like this
drw_setscheme(drw, tagschemes[i]);
I did that and my whole dwm crashed :( ,keybinds werent working too
Sorry, you should use it as an index to scheme
like this
drw_setscheme(drw, scheme[tagschemes[i]]);
and if you use colorfultag
configuration, dont forget to add it
drw_setscheme(drw, scheme[m->colorfultag ? tagschemes[i] : SchemeSel]);
wouldnt it be better to color them only if they're occupied? :D
Yes, you could do that, just change the condition, use m->sel
instead, like this
drw_setscheme(drw, scheme[m->sel ? (m->colorfultag ? tagschemes[i] : SchemeSel) : SchemeTag]);
wouldnt it be better to color them only if they're occupied? :D
Yes, you could do that, just change the condition, use
m->sel
instead, like thisdrw_setscheme(drw, scheme[m->sel ? (m->colorfultag ? tagschemes[i] : SchemeSel) : SchemeTag]);
I added only this and it removes the colors if current workspace has no windows :c
simplescreenrecorder-2021-07-24_22.34.50.mp4
I want tags ( having 0 windows ) to have normal color and occupied have their (tagsel colors) too , is this possible?
Can you tell me what behavior you want ? like what happen if the tag is selected/unselected or what happen if there are a client or not, actually it is very customizable
wouldnt it be better to color them only if they're occupied? :D
'occupied' means there are a client ?
Can you tell me what behavior you want ? like what happen if the tag is selected/unselected or what happen if there are a client or not, actually it is very customizable
( tags = workspace)
suppose 1,2 tags are occupied
I go to 3rd tag and its empty by default so all tags reset to normal colors which I dont want!
```c drw_setscheme(drw, tagschemes[i]);wouldnt it be better to color them only if they're occupied? :D
'occupied' means there are a client ?
yes
Maybe occ & 1 << i
is what you mean, so replace the m->sel
drw_setscheme(drw, scheme[occ & 1 << i ? (m->colorfultag ? tagschemes[i] : SchemeSel) : SchemeTag]);
thanks for the help @fitrh! seems like you're writing your own nvim config in lua too , you could check and use my config (nvchad) https://github.com/siduck76/NvChad , I cant thank you enough!
Thank you, nice config btw, but i always prefer to write config by my self because it always give the best of understanding
Hi, I path my dwm with your code, and it doesnt crash jeje, but. How can I put the colors on every tag name, I mean, have the colors even if the tags are empty. Hope you can help me with thath. Regards from mexico.
Hi @engjpacheco, inside the loop for drawing tags, just put something like this drw_setscheme(drw, tagschemes[i])
ok, i´ll try, remove the if statent and replace this drw_setscheme(drw, scheme[tagscheme]); with this: drw_setscheme(drw, tagschemes[i])
Thank u so much, you definetly need to do the patch and post it to suckless page, ASAP, jeje.
Thank you again, regards from Mexico.
ok, i´ll try, remove the if statent and replace this drw_setscheme(drw, scheme[tagscheme]); with this: drw_setscheme(drw, tagschemes[i])
Thank u so much, you definetly need to do the patch and post it to suckless page, ASAP, jeje.
Thank you again, regards from Mexico.
agreed! @fitrh you gotta submit this awesome patch to suckless page :D
@fitrh I made it, I kinda make a hybrid mode with rainbow tags and some of your knowledge. Here are the result of the tags :)
@engjpacheco cool, I suggest you to combined it with vacant tags, or even bar border, gap, and indictor and make it toggleable
simplescreenrecorder-2021-10-14_11.11.24.mp4
Yeah I patched with hide vacant tag, but I think I'm gonna unpatch it, because I was thinking on put the bar that you mentioned, but I don't know this kind of C source blow my mind I thin k Im not to prepare for that jajaja, but definitely I gonna make that. Thanks for share your knowledge.
What is the name of the vacanttag patch you mentioned, now I want to make the line follow only the active window,
It is hide vacant tags with some modification
This is the result of your help, thank you for your time !. @fitrh
@fitrh I made it, I kinda make a hybrid mode with rainbow tags and some of your knowledge. Here are the result of the tags :)
Hey @engjpacheco can you help me to get bar like yours (pacman)
@yogeshdcool sure, what can I do for you?, The pacman icons are in the Material font. I only put them in my Xmenu icon (pacman), and the ghost is the icon of the stack style. The dots are the tags.
@engjpacheco I need the colorfultags patch do you have it or did you applied it manually
@yogeshdcool look, this is what I done:
1.-patch with the colorfultag patch.
2.-and add this to the dwm.c file:
in the drawbar(Monitor) function.
w = TEXTW(tagtext);
**drw_setscheme(drw, tagscheme[i]);**
@engjpacheco cool, I suggest you to combined it with vacant tags, or even bar border, gap, and indictor and make it toggleable
simplescreenrecorder-2021-10-14_11.11.24.mp4
where can i find this bar border patch? it looks great
@superstefan420 you can find the initial implementation in this commit
Is this in a .diff file?
@Spaxly not yet, but you can use the relevant commits as reference
@fitrh thanks a lot for creating this very useful patch it is soo awesome ^_^ ... I Heavily appreciate your work .... works like a complete charm