Comments (5)
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.
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.
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.
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:
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.
⡏⣭⡍⡇⡪⠡⠴⠰⠳⠗⠻⠬⠘⠡⠆⠈⠅⡏⣭⡍⡇
⠧⠭⠥⠇⠆⠄⢄⣄⣔⣖⣖⣖⣄⡄⠄⠄⠄⠧⠭⠥⠇
⠫⡭⠗⠍⠁⣴⠋⠉⠁⠀⠀⠀⠀⠉⢯⡒⡞⢪⣚⢸⡆
⣐⡅⡨⠅⣸⡇⠃⠀⠀⠀⠐⠀⠀⠈⠘⢻⢀⡄⣋⢃⠃
⠤⢥⠟⠅⢿⡇⠀⣠⣤⠀⠀⣠⣄⠰⢽⣜⡐⢺⡊⢀⠀
⡼⠁⣠⠅⠘⡇⠈⠙⠋⠁⠈⠙⠛⠋⠈⡏⢠⡀⠏⣉⠃
⠁⢚⡨⠅⠇⡇⠀⠀⠀⣠⢠⠀⠀⠠⣼⠓⠆⢺⡊⠮⠅
⡎⡫⡞⠅⠀⢰⣄⢠⡄⣛⣸⣤⣄⣸⡽⡊⢠⡀⠤⢗⡂
⡥⠤⠭⡅⠇⣩⣿⡮⣂⢲⢂⣂⢻⡯⢺⣦⡏⠍⡿⠟⠁
⡇⠿⠇⡇⡇⣾⡏⠛⠿⢿⡟⣷⢟⣻⡿⢑⠩⢽⠅⣯⠁
⠉⠉⠉⠁⠁⠉⠁⠀⠈⠁⠀⠀⠈⠉⠉⠈⠁⠈⠈⠁⠀
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)
- A couple of patches HOT 1
- Delete key does not work in bash after using abduco to reconnect to dvtm HOT 3
- KEY_LEFT KEY_RIGHT and KEY_HOME don't work in separate st with abduco HOT 3
- Doesn't display all 256 colors, only 204 or 209 HOT 2
- attachaside patch HOT 6
- Call for Project Maintenance HOT 17
- Jump for backward/fordward (word) with ctrl+arrow key doesn't work. HOT 2
- Option to hide title bars HOT 2
- Segmentation faults HOT 6
- Building on OpenBSD
- Two Patches and Escape Questions HOT 1
- mod+c not creating a new window HOT 2
- Unable to change cursor type with escape sequences HOT 1
- Paste does not seem to work on OpenBSD
- Behavior when cmd is passed HOT 1
- Terminal colors change as I type when in dvtm HOT 1
- Anyone able to build on MSYS2 Windows 11 ?
- togglebar() doesn't work with #define BAR_POS BAR_OFF in config.h
- Large copy buffer deadlock
- Is it possible to run a couple of commands each with different tags? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dvtm.