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

Colorful tag patch #1

Closed
siduck opened this issue Jul 24, 2021 · 45 comments
Closed

Colorful tag patch #1

siduck opened this issue Jul 24, 2021 · 45 comments

Comments

@siduck
Copy link

siduck commented Jul 24, 2021

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

image

@fitrh
Copy link
Owner

fitrh commented Jul 24, 2021

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

@siduck
Copy link
Author

siduck commented Jul 24, 2021

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 :)

@fitrh
Copy link
Owner

fitrh commented Jul 24, 2021

Just use those 2 commits

@siduck
Copy link
Author

siduck commented Jul 24, 2021

Just use those 2 commits
I did but i dont have alttag patch added :c

where do I add this?

image

@fitrh
Copy link
Owner

fitrh commented Jul 24, 2021

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);

@siduck
Copy link
Author

siduck commented Jul 24, 2021

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

@fitrh
Copy link
Owner

fitrh commented Jul 24, 2021

Is you trying to apply the patch for this build ? if so, addit before this line

@fitrh
Copy link
Owner

fitrh commented Jul 24, 2021

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

@siduck
Copy link
Author

siduck commented Jul 24, 2021

@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

@siduck
Copy link
Author

siduck commented Jul 24, 2021

I added the colorful patch only : siduck/chadwm@d1223ea

@fitrh
Copy link
Owner

fitrh commented Jul 24, 2021

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]);

@siduck
Copy link
Author

siduck commented Jul 24, 2021

```c
drw_setscheme(drw, tagschemes[i]);

wouldnt it be better to color them only if they're occupied? :D

@siduck
Copy link
Author

siduck commented Jul 24, 2021

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
image

@fitrh
Copy link
Owner

fitrh commented Jul 24, 2021

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]);

@fitrh
Copy link
Owner

fitrh commented Jul 24, 2021

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]);

@siduck
Copy link
Author

siduck commented Jul 24, 2021

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]);

I added only this and it removes the colors if current workspace has no windows :c

simplescreenrecorder-2021-07-24_22.34.50.mp4

@siduck
Copy link
Author

siduck commented Jul 24, 2021

I want tags ( having 0 windows ) to have normal color and occupied have their (tagsel colors) too , is this possible?

@fitrh
Copy link
Owner

fitrh commented Jul 24, 2021

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

@fitrh
Copy link
Owner

fitrh commented Jul 24, 2021

wouldnt it be better to color them only if they're occupied? :D

'occupied' means there are a client ?

@siduck
Copy link
Author

siduck commented Jul 24, 2021

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!

@siduck
Copy link
Author

siduck commented Jul 24, 2021

```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

@fitrh
Copy link
Owner

fitrh commented Jul 24, 2021

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]);

@siduck siduck closed this as completed Jul 24, 2021
@siduck
Copy link
Author

siduck commented Jul 24, 2021

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!

@fitrh
Copy link
Owner

fitrh commented Jul 24, 2021

Thank you, nice config btw, but i always prefer to write config by my self because it always give the best of understanding

@engjpacheco
Copy link

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.

@fitrh
Copy link
Owner

fitrh commented Oct 4, 2021

Hi @engjpacheco, inside the loop for drawing tags, just put something like this drw_setscheme(drw, tagschemes[i])

@fitrh
Copy link
Owner

fitrh commented Oct 4, 2021

In my recent build, remove these lines and replace this line with above code

@engjpacheco
Copy link

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.

@siduck
Copy link
Author

siduck commented Oct 4, 2021

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

@engjpacheco
Copy link

@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 :)

IMG_20211013_220737808.jpg

@fitrh
Copy link
Owner

fitrh commented Oct 14, 2021

@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

@engjpacheco
Copy link

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.

@engjpacheco
Copy link

What is the name of the vacanttag patch you mentioned, now I want to make the line follow only the active window,

@fitrh
Copy link
Owner

fitrh commented Oct 15, 2021

It is hide vacant tags with some modification

@engjpacheco
Copy link

IMG_20211017_162256_491.jpg

This is the result of your help, thank you for your time !. @fitrh

@yogeshdnumb
Copy link

yogeshdnumb commented Oct 24, 2021

@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 :)

IMG_20211013_220737808.jpg

Hey @engjpacheco can you help me to get bar like yours (pacman)

@engjpacheco
Copy link

engjpacheco commented Oct 24, 2021

@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.

@yogeshdnumb
Copy link

@engjpacheco I need the colorfultags patch do you have it or did you applied it manually

@engjpacheco
Copy link

engjpacheco commented Oct 26, 2021

@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]);**

@940319082
Copy link

@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

@fitrh
Copy link
Owner

fitrh commented Apr 25, 2022

@superstefan420 you can find the initial implementation in this commit

@ohxxm
Copy link

ohxxm commented Sep 18, 2022

Is this in a .diff file?

@fitrh
Copy link
Owner

fitrh commented Sep 18, 2022

@Spaxly not yet, but you can use the relevant commits as reference

@ohxxm
Copy link

ohxxm commented Sep 19, 2022

@fitrh Thanks.

@sivaplaysmC
Copy link

@fitrh thanks a lot for creating this very useful patch it is soo awesome ^_^ ... I Heavily appreciate your work .... works like a complete charm

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

7 participants