Giter Site home page Giter Site logo

Comments (5)

 avatar commented on July 24, 2024

Maybe it is possible to display the tag numbers rather than the tag names, to save space in the title bar. The implementation would be rather the same.

from dvtm.

martanne avatar martanne commented on July 24, 2024

I will have to try it, but my initial reaction is that it probably uses too much screen space?

Maybe we could use different colors per tag or something like that. However we would still need to display a symbol (the number?) per tag. Although displaying such a rainbow might also be a distraction.

I generally use topical tags for things like "irc", "mail", "devel" and it is implicitly clear which window belongs to which tag. Also if multiple tags are selected, the tagbar at the top indicates which ones are currently active.

As for the code, in C it is quite common to do low level bit shifting, 1 << i as done in the drawbar function should be sufficient, no need for math.h. If you still need the math library for something it should be added to the $LIBS variable in config.mk instead of directly to the Makefile.

from dvtm.

 avatar commented on July 24, 2024

After using it a few, feels like too much screen space is used. Maybe the tag numbers, but I think dwm approach was still the best: a mark on the tags that the window have, on the tagbar.

I will try something and hopefully I will get it to work. If I do I will come back with a screencast.

I'm still learning C, trying to stick to the suckless way, and you are really helping with these tips. Thank you for taking the time to explain.

from dvtm.

 avatar commented on July 24, 2024

Here is a new proposition: Rather than displaying each of the tag names in borders, the format string used to display a tag in the bar, TAG_SYMBOL can be different for when the tag owns a focused:

screencast

So adding the option to config.def.h (this will break compatibility of older config.h, unfortunately).

diff --git a/config.def.h b/config.def.h
index 643a281..8e6a77a 100644
--- a/config.def.h
+++ b/config.def.h
@@ -45,6 +45,8 @@ static Color colors[] = {
 #define SCROLL_HISTORY 500
 /* printf format string for the tag in the status bar */
 #define TAG_SYMBOL   "[%s]"
+/* printf format string for the tags that current focused window */
+#define TAG_SYMBOL_FOCUSED   "[%s]"
 /* curses attributes for the currently selected tags */
 #define TAG_SEL      (COLOR(BLUE) | A_BOLD)
 /* curses attributes for not selected tags which contain no windows */

Adding a condition to use either of the two format string.

diff --git a/dvtm.c b/dvtm.c
index c6440ab..41df797 100644
--- a/dvtm.c
+++ b/dvtm.c
@@ -339,7 +339,10 @@ drawbar(void) {
            attrset(TAG_OCCUPIED);
        else
            attrset(TAG_NORMAL);
-       printw(TAG_SYMBOL, tags[i]);
+       if (sel && sel->tags & (1 << i))
+           printw(TAG_SYMBOL_FOCUSED , tags[i]);
+       else
+           printw(TAG_SYMBOL , tags[i]);
    }

    attrset(TAG_NORMAL);

And now, while we switch client, we also need to redraw the status bar, and not only the border.

@@ -585,6 +588,7 @@ focus(Client *c) {
            draw_border(c);
            wnoutrefresh(c->window);
        }
+       drawbar();
    }
    curs_set(c && !c->minimized && vt_cursor_visible(c->term));
 }

The new patch, if needed.

[EDIT]: Fixed tags not shown while no window selected.

There is absolutely no hurry to have. I use this patch already.

from dvtm.

 avatar commented on July 24, 2024
⡏⣭⡍⡇⡪⠡⠴⠰⠳⠗⠻⠬⠘⠡⠆⠈⠅⡏⣭⡍⡇
⠧⠭⠥⠇⠆⠄⢄⣄⣔⣖⣖⣖⣄⡄⠄⠄⠄⠧⠭⠥⠇
⠫⡭⠗⠍⠁⣴⠋⠉⠁⠀⠀⠀⠀⠉⢯⡒⡞⢪⣚⢸⡆
⣐⡅⡨⠅⣸⡇⠃⠀⠀⠀⠐⠀⠀⠈⠘⢻⢀⡄⣋⢃⠃
⠤⢥⠟⠅⢿⡇⠀⣠⣤⠀⠀⣠⣄⠰⢽⣜⡐⢺⡊⢀⠀
⡼⠁⣠⠅⠘⡇⠈⠙⠋⠁⠈⠙⠛⠋⠈⡏⢠⡀⠏⣉⠃
⠁⢚⡨⠅⠇⡇⠀⠀⠀⣠⢠⠀⠀⠠⣼⠓⠆⢺⡊⠮⠅
⡎⡫⡞⠅⠀⢰⣄⢠⡄⣛⣸⣤⣄⣸⡽⡊⢠⡀⠤⢗⡂
⡥⠤⠭⡅⠇⣩⣿⡮⣂⢲⢂⣂⢻⡯⢺⣦⡏⠍⡿⠟⠁
⡇⠿⠇⡇⡇⣾⡏⠛⠿⢿⡟⣷⢟⣻⡿⢑⠩⢽⠅⣯⠁
⠉⠉⠉⠁⠁⠉⠁⠀⠈⠁⠀⠀⠈⠉⠉⠈⠁⠈⠈⠁⠀

This is just because I like your avatar, and wanted to try this. Render may vary according to your font.

from dvtm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.