You are not logged in.

#176 2012-11-12 12:12:06

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,983
Website

Re: Alopex: a tiling tagging tabbed window manager with fur

cab.c is a C file - it needs to be compiled.  I do need to package this a bit better, that is on the todo list.

But all you should need to do to run ttwm from a folder like you are doing is the following:

cd ~/ttwm
gcc -o cab cab.c

Then your xinitrc line could be either of the following, but I'd recommend the second* so I have commented the first:

#exec ~/ttwm/cab | ~/ttwm/ttwm
exec ~/ttwm/ttwm ~/ttwm/cab

If you decide to fully install these, ttwm has two aur packages (one v1,0 ont git development - currently the two are pretty similar).  While there is not AUR package yet, I have made the makefile in the rectabar repo on github a bit more useful - you can use it to fully install cab and the vol script.  Note, however, that this does bypass pacman for those two files.

Once rectabar has it's own aur package this will be fixed and rectabar will be listed as an optional dependency for ttwm in order to provide `cab` and `vol`.

*note: feeding to stdin is still available for "backwards compatibility" but this will be dropped in the 2.0 release (which isn't scheduled for anytime in the near future).  This will avoid the problem with any display manager that breaks the stdin stream.  In other words, it'd be better to get used to the new notation now, which also carries a few other benefits over piping.

EDIT: I take back some of the above - `cab` and vol will never be fully installed by any future PKGBUILD.  cab, in particular can require some machine-specific customization.  Perhaps they will be included with the demo scripts and put into someplace like /usr/share/rectabar/ as examples of how rectabar can be used.

Last edited by Trilby (2012-11-12 12:49:23)


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Online

#177 2012-11-12 17:41:21

netfun81
Member
Registered: 2008-07-20
Posts: 32

Re: Alopex: a tiling tagging tabbed window manager with fur

Thanks for quick response Trilby!   That did the trick, I now have a working CPU status bar.  The volume graph is not working though, may need some changes in the script since I'm on Debian testing.   I will look into it further.

Offline

#178 2012-11-12 17:48:19

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,983
Website

Re: Alopex: a tiling tagging tabbed window manager with fur

Netfun, the volume bar would not work until you have use the "vol" script at least once.  If it is bound to a keybinding, just use the key binding, or from a terminal do "vol up" or "vol down" (as your regular user).

BGC, the bottom status tabs have been flipped, so they should look better now.  Also the status bar can now be moved while running with a new keybinding set as Mod+x as default (why x? because I'm running out of keys to bind!)

Last edited by Trilby (2012-11-12 19:56:39)


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Online

#179 2012-11-12 18:46:03

netfun81
Member
Registered: 2008-07-20
Posts: 32

Re: Alopex: a tiling tagging tabbed window manager with fur

Trilby, I just logged on to edit my post that I got the volume bar to work, but you already replied.. you're fast :}  And correct with your reply.  Just had to make sure vol was in the path and then edit config.h to bind with the keys I wanted.  Works fine..thanks again for nice wm.

Offline

#180 2012-11-12 20:24:57

bgc1954
Member
From: Edmonton, AB, Canada
Registered: 2006-03-14
Posts: 1,120

Re: Alopex: a tiling tagging tabbed window manager with fur

Trilby, nice work!  The tabs look much better flipped on the bottom now.  Myself, I chose mod+shift+x as I switched mod+p to mod+x as I was more brain-tied to that combo from other wm's for dmenu.  It's good for the old noggin to try and remember all the keybindings but as I tend to try out new wm's fairly often, I'm constantly switching things to what I'm used to.  Ttwm is doing everything I want, without any real showstoppers, so I might have to settle in...for a while at least. wink

Hope all the statusbar stuff didn't increase the size of ttwm much.  It's so nice and compact as it is or was.

Last edited by bgc1954 (2012-11-12 20:25:33)


Time is a great teacher, but unfortunately it kills all its pupils ... - Louis Hector Berlioz

Offline

#181 2012-11-12 20:28:12

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,983
Website

Re: Alopex: a tiling tagging tabbed window manager with fur

Nope, It only really added two new lines of code, one 1 byte data structure (Bool topbar) and a couple ternary operators in calls to Xlib drawing routines that were already in the status bar drawing function.


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Online

#182 2012-11-12 20:36:22

bgc1954
Member
From: Edmonton, AB, Canada
Registered: 2006-03-14
Posts: 1,120

Re: Alopex: a tiling tagging tabbed window manager with fur

Trilby wrote:

*note: feeding to stdin is still available for "backwards compatibility" but this will be dropped in the 2.0 release (which isn't scheduled for anytime in the near future).  This will avoid the problem with any display manager that breaks the stdin stream.  In other words, it'd be better to get used to the new notation now, which also carries a few other benefits over piping.

I was curious when I read this.  How will this new notation really change the way my status.sh script works in the statusbar or will it?


Time is a great teacher, but unfortunately it kills all its pupils ... - Louis Hector Berlioz

Offline

#183 2012-11-12 20:47:22

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,983
Website

Re: Alopex: a tiling tagging tabbed window manager with fur

You should be able to use the new invocation just fine.  Switch `exec /path/to/status.sh | ttwm` to `exec ttwm /path/to/status.sh`.  I thought you already had changed this.  Up to v2.0 (which could be a long way off) both forms will work, but the second form is a little cleaner and will avoid some minor hang ups.

The difference is that instead of reading input from stdin, ttwm will launch whatever is passed as it's first argument as a child process.  It will read the output of this child process and handle it exactly like it would have handled the piped input.  The benefits are that there is no lag when you try to exit ttwm, and if you check out htop or pstree while ttwm is running, you will see the pipe seems to break the exec command and the xinitrc script is never really replaced.

So, in otherwords, from a user's perspective there should be virtually no difference, but from the system's perspective, the second is more orderly.

Last edited by Trilby (2012-11-12 20:50:28)


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Online

#184 2012-11-13 02:05:37

Mad_Hatter93
Member
Registered: 2012-06-30
Posts: 19

Re: Alopex: a tiling tagging tabbed window manager with fur

So when I attempt to run TTWM, I get the error below if I run from terminal in X, through SLiM it just crashes. I've been reading and trying to figure out if this is a common error, but I can't find anything. I have terminus-font installed.

======== TTWM ERROR ========
request=45; error=15
BadName (named color or font does not exist)============================
zsh: segmentation fault  ttwm

Offline

#185 2012-11-13 02:08:25

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,983
Website

Re: Alopex: a tiling tagging tabbed window manager with fur

Hmm, I was going to say it was probably the font.  I need to either list terminus as a dependency or just pick a standard X font for the default.

Are you using the default config and getting that error?  If this is a custom config.h can you post the top ~dozen lines?

EDIT: this could still be the font if you just installed terminus to solve that error.  If that's the case does terminus work in terminals, or does ttwm work with a different font selection?  I'm wondering if the font could be installed but not listed in x's font cache - terminus is installed to /usr/share/fonts/local which has to be added to the font paths.

On a related note, if anyone can recommend a nice font that comes with a base X install I'll replace terminus with that for the default config.

Last edited by Trilby (2012-11-13 02:10:46)


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Online

#186 2012-11-13 02:20:17

Mad_Hatter93
Member
Registered: 2012-06-30
Posts: 19

Re: Alopex: a tiling tagging tabbed window manager with fur

Got a font to suggest I try? Or, alternatively, how to add that font path permanently? xset fp+ seems to be temporary...

Offline

#187 2012-11-13 02:23:37

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,983
Website

Re: Alopex: a tiling tagging tabbed window manager with fur

To test whether this is the issue you can use any font string from xfontsel.

To add that font path permanently you'd just add it to your xorg.conf as described here then just restart X.


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Online

#188 2012-11-13 02:31:58

Mad_Hatter93
Member
Registered: 2012-06-30
Posts: 19

Re: Alopex: a tiling tagging tabbed window manager with fur

Ahh, there we go, got it up and running, mostly =P now to customize... I noticed mouse support is minimal at best =P

Offline

#189 2012-11-13 02:43:59

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,983
Website

Re: Alopex: a tiling tagging tabbed window manager with fur

Mouse support? No ... it's not minimal, it's non existent.   Well, except for the move/resize inherited from tinywm.

This is not a temporarily underdeveloped aspect - ttwm will never have more mouse actions.


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Online

#190 2012-11-13 03:18:42

Mad_Hatter93
Member
Registered: 2012-06-30
Posts: 19

Re: Alopex: a tiling tagging tabbed window manager with fur

I didn't really expect it to, I'm just used to follow-focus, so it threw me off for a sec.

Offline

#191 2012-11-13 04:47:13

bgc1954
Member
From: Edmonton, AB, Canada
Registered: 2006-03-14
Posts: 1,120

Re: Alopex: a tiling tagging tabbed window manager with fur

Trilby wrote:

  I thought you already had changed this.  Up to v2.0 (which could be a long way off) both forms will work, but the second form is a little cleaner and will avoid some minor hang ups.

Yes, I had, so the upshot is that my current use "exec ttwm /home/brian/bin/status.sh or exec ttwm/home/brian/bin/dzconky-ttwm" will be fine for future and present use--thus my confusion--but you have assuaged this so thank you.

Last edited by bgc1954 (2012-11-13 04:56:25)


Time is a great teacher, but unfortunately it kills all its pupils ... - Louis Hector Berlioz

Offline

#192 2012-11-14 02:11:05

bgc1954
Member
From: Edmonton, AB, Canada
Registered: 2006-03-14
Posts: 1,120

Re: Alopex: a tiling tagging tabbed window manager with fur

Just updating my netbook and I noticed that the flip bar option--your mod+x--loses my dzconky-ttwm script when switching from top to bottom.  This doesn't happen on my desktop using my status.sh script.  I don't need the statusbar on the bottom for my netbook but just thought I'd point it out.


Time is a great teacher, but unfortunately it kills all its pupils ... - Louis Hector Berlioz

Offline

#193 2012-11-14 02:14:41

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,983
Website

Re: Alopex: a tiling tagging tabbed window manager with fur

Hmm, thanks - I'll have to look into that.  Off the top of my head I don't know how that could be effected as it really only does change the coordinates at which the pixmap is painted - everything about how the input is put together into a pixmap is identical.

For clarification, is the dzconky-ttwm script provided on the command line like status.sh, or is it a separate tool?  If it is passed on the command line, would you mind sharing/linking the script so I can try to replicate the problem?


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Online

#194 2012-11-14 02:19:00

2ManyDogs
Member
Registered: 2012-01-15
Posts: 1,686

Re: Alopex: a tiling tagging tabbed window manager with fur

Trilby wrote:

On a related note, if anyone can recommend a nice font that comes with a base X install I'll replace terminus with that for the default config.

I think misc-fixed is the "default" X font, and many people like it.

Offline

#195 2012-11-14 02:20:54

bgc1954
Member
From: Edmonton, AB, Canada
Registered: 2006-03-14
Posts: 1,120

Re: Alopex: a tiling tagging tabbed window manager with fur

@Trilby- don't bother, as I just think I figured out the problem.  Not on your end as my dzen/conky script places the bar in a designated place with x, y coordinates.  I just saw this when I tried the flip bar key combo with no app running and the statusbar moves from top to bottom as it should but the dzen/conky stays by itself on the top as it is told to by my dzconky-ttwm script.  So it's not a ttwm problem.

edit: I'll have to get around to making a status.sh script for my netbook, I guess.

Last edited by bgc1954 (2012-11-14 03:05:13)


Time is a great teacher, but unfortunately it kills all its pupils ... - Louis Hector Berlioz

Offline

#196 2012-11-14 03:34:44

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,983
Website

Re: Alopex: a tiling tagging tabbed window manager with fur

2ManyDogs wrote:

I think misc-fixed is the "default" X font, and many people like it.

Thanks, I replaced terminus with a misc-fixed font in the default config.


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Online

#197 2012-11-14 05:04:46

bgc1954
Member
From: Edmonton, AB, Canada
Registered: 2006-03-14
Posts: 1,120

Re: Alopex: a tiling tagging tabbed window manager with fur

I'm pulling my non-existant hair out over this script for my netbook.  It showed more than it does now at one time but now all it shows is CPU:2%:1333

The script is

#! /bin/sh

while true; do

eval $(awk '/^cpu /{print "previdle=" $5 "; prevtotal=" $2+$3+$4+$5 }' /proc/stat); sleep 0.4; eval $(awk '/^cpu /{print "idle=" $5 "; total=" $2+$3+$4+$5 }' /proc/stat); intervaltotal=$((total-${prevtotal:-0})); echo "{#cccccc}CPU:$((100*( (intervaltotal) - ($idle-${previdle:-0}) ) / (intervaltotal) ))%:$(cat /proc/cpuinfo | grep MHz | awk '{printf "%.0f\n", $4}')Mhz RAM:$(free -m | grep -i /cache | awk '{print$3}')Mb T:$(($(cat /sys/bus/acpi/devices/LNXTHERM:00/thermal_zone/temp) / 1000))C $(cat /sys/bus/acpi/drivers/battery/PNP0C0A:00/power_supply/BAT0/status` battery at $((100*`cat /sys/class/power_supply/BAT1/charge_now`/\`cat /sys/class/power_supply/BAT01/charge_full`))% $(date +%m/%d)"

sleep 5

done

Any help would be appreciated.  Thx.


Time is a great teacher, but unfortunately it kills all its pupils ... - Louis Hector Berlioz

Offline

#198 2012-11-14 10:03:21

wirr
Member
Registered: 2009-10-25
Posts: 68

Re: Alopex: a tiling tagging tabbed window manager with fur

Hi bgc

The "`" between the words "status" and "battery" at line 5 is wrong.

Why do you write everything on one line? It's much easier to debug if you refactor it in this direction:

#! /bin/sh

cpuusage() {
        eval $(awk '/^cpu /{print "previdle=" $5 "; prevtotal=" $2+$3+$4+$5 }' /proc/stat)
        sleep 0.4
        eval $(awk '/^cpu /{print "idle=" $5 "; total=" $2+$3+$4+$5 }' /proc/stat)
        intervaltotal=$((total-${prevtotal:-0}))
        echo -n "CPU:$((100*( (intervaltotal) - ($idle-${previdle:-0}) ) / (intervaltotal) ))%:"
}

cpumhz() {
        awk '/MHz/{printf "%.0f ", $4}' /proc/cpuinfo
}

ramusage() {
        echo -n "RAM:$(free -m | grep -i /cache | awk '{print$3}')Mb "
}

while true; do

        echo -n "{#cccccc}"
        cpuusage
        cpumhz
        ramusage
echo -n "T:$(($(cat /sys/bus/acpi/devices/LNXTHERM:00/thermal_zone/temp) / 1000))C "
echo -n "$(cat /sys/bus/acpi/drivers/battery/PNP0C0A:00/power_supply/BAT0/status) battery at $((100*$(cat /sys/class/power_supply/BAT0/charge_now)/$(cat /sys/class/power_supply/BAT0/charge_full)))% "
        date +%m/%d

        sleep 5

done

Last edited by wirr (2012-11-15 15:14:08)

Offline

#199 2012-11-14 11:32:32

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,983
Website

Re: Alopex: a tiling tagging tabbed window manager with fur

I'm not a fan of splitting into functions*, but that could definitely be split into lines which would make problems easier to find.  You have a "print$3" in an awk command rather than "print $3".

This might also inspire a new meme: the useless use of cat named grep... The following two pseudo code blocks would do the exact same thing:

cat filename | grep row_content | awk '{printt $fieldnum;}'
awk '/row_content/ {print $fieldnum;}' filename

The second, though is easier to read, easier to troubleshoot, and starts 1 process instead of three.  If ths is run in a loop, for several different files, you can go from starting dozens of processes every time through the loop to just a few.

There are even ways of using just one awk script that changes which file it is getting input from while running, but that is a step or two more involved.

*Note: I don't actually know exactly how bash treats functions.  I don't believe bash is capable of the equivalent of "inlining" short one-line functions as in the example from the previous post.  I suspect bash may even create subshells for each function call (it does create a new namespace).  In the later case function calls for one line of code that is not reused anywhere else would be a significant resource drain on a script like this.  In either case it would be some degree of drain.

EDIT: I just started converting my dwmStatus program for ttwm.  It is up on my dwmStatus repo here.  I don't actually use this, but it seems a small handful of dwm users have found it a good starting point for their own.

Last edited by Trilby (2012-11-14 13:29:18)


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Online

#200 2012-11-14 18:43:51

bgc1954
Member
From: Edmonton, AB, Canada
Registered: 2006-03-14
Posts: 1,120

Re: Alopex: a tiling tagging tabbed window manager with fur

Well, today is a new day and I'm more rested and not wine addled.  The first problem I had was that this netbook has a dual core atom processor and the first part of the script tried to write two lines for the mhz result I wanted.  I did some reading and used "cut" to eliminate the second core spitting out info I didn't want.  The battery part I cobbled together from something I got from googling and it wasn't quite correct s o I had to adjust that as well.  Now I have something that works quite well and I still use a long one line--it's what I'm used to. smile

This is what I have now

#! /bin/sh

while true; do

eval $(awk '/^cpu /{print "previdle=" $5 "; prevtotal=" $2+$3+$4+$5 }' /proc/stat); sleep 0.4; eval $(awk '/^cpu /{print "idle=" $5 "; total=" $2+$3+$4+$5 }' /proc/stat); intervaltotal=$((total-${prevtotal:-0})); echo "{#cccccc}CPU:$((100*( (intervaltotal) - ($idle-${previdle:-0}) ) / (intervaltotal) ))%:$(cat /proc/cpuinfo | grep MHz | awk '{printf "%.0f", $4}' | cut -c 1-4)Mhz RAM:$(free -m | grep -i /cache | awk '{print $3}')Mb T:$(($(cat /sys/bus/acpi/devices/LNXTHERM:00/thermal_zone/temp) / 1000))C BAT:$(cat /sys/class/power_supply/BAT0/status | cut -b 1-5):$((100*`cat /sys/class/power_supply/BAT0/charge_now` / `cat /sys/class/power_supply/BAT0/charge_full`))% $(date +%m/%d)"

sleep 5

done

I know its not pretty and certainly could be done differently but I'm happy with my own efforts this morning and figuring it out on my own.  It was alot of trial and error.  Like you said, Trilby, too much grep, awk, cut, etc. to wrap my brain around.  Thanks for your input, though.  I will likely try to tweak it for something to do today, and try out the suggestions offered.  Thx again. big_smile

tZ2FoaQThis is how it looks.

Last edited by bgc1954 (2012-11-14 19:02:17)


Time is a great teacher, but unfortunately it kills all its pupils ... - Louis Hector Berlioz

Offline

Board footer

Powered by FluxBB