You are not logged in.

#1301 2013-08-20 20:36:02

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

I invoke xrandr directly from ~/.xinitrc to set the screen in multimonitor setup

xrandr --output DVI-I-1 --primary --auto --right-of DVI-I-2 --auto

I guess what you want is:

xrandr --output DVI-I-1 --auto --right-of DVI-I-2 --auto --primary

.:[ git me! ] :.

Offline

#1302 2013-08-20 20:36:26

Unia
Member
From: The Netherlands
Registered: 2010-03-30
Posts: 2,471
Website

Re: monsterwm! ~ yet another tiny wm

Nevermind

Last edited by Unia (2013-08-20 20:38:25)


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

Offline

#1303 2013-08-20 20:40:15

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

The xinerama branches have been stable and working long time now.
xinerama-core is built directly on top of monsterwm core
and xinerama-master is in line with monsterwm master


.:[ git me! ] :.

Offline

#1304 2013-08-20 22:05:56

v2punkt0
Member
From: Germany
Registered: 2008-03-09
Posts: 6
Website

Re: monsterwm! ~ yet another tiny wm

your xrandr line makes it like when i just use my xorg.conf, there's no difference.

Am i supposed to use the xinerama branch btw? Because i am not at the moment.

edit: well, yes, i suppose i am. it works..
now i just need a new dzen2/xinitrc script sad

thanks!

Last edited by v2punkt0 (2013-08-20 22:21:27)

Offline

#1305 2013-08-21 04:54:51

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

The script is no much different, two new values are added at the start of the line
indicating the screen id and the whether that screen is the currently focused one.
take a look in http://gist.github.com/c00kiemon5ter/1905427


.:[ git me! ] :.

Offline

#1306 2013-08-21 05:45:36

v2punkt0
Member
From: Germany
Registered: 2008-03-09
Posts: 6
Website

Re: monsterwm! ~ yet another tiny wm

c00kiemon5ter wrote:

The script is no much different, two new values are added at the start of the line
indicating the screen id and the whether that screen is the currently focused one.
take a look in http://gist.github.com/c00kiemon5ter/1905427

I was using the one with the "monsterwm2dzen_with-titles_dwm-like" one but it makes a mess with my 2 monitors now.
Trying the other one for dzen2 it looks almost the same, here's a screenshot: http://i.imgur.com/ymEswew.png

when switching monitors it moves the "1s" from web to dev but that's it

Offline

#1307 2013-08-21 06:33:42

F34R
Member
From: /dev/loliland
Registered: 2012-02-05
Posts: 238

Re: monsterwm! ~ yet another tiny wm

I use terminus for bar , nope i not solved problem with dmenu and replaced via interrobang.

terminus doesn't have the japanese glyphs iirc, so you may want to add a font in the FONT line in bar's config.h, so that it will fallback to that font to search for those glyphs.


Can I have more than two font ? artwiz & terminus font set in config.h.

Offline

#1308 2013-08-21 08:53:56

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

F34R wrote:

I use terminus for bar , nope i not solved problem with dmenu and replaced via interrobang.

terminus doesn't have the japanese glyphs iirc, so you may want to add a font in the FONT line in bar's config.h, so that it will fallback to that font to search for those glyphs.


Can I have more than two font ? artwiz & terminus font set in config.h.

I use the following to get the "icons" from stlarch and everything else from terminus

#define BAR_FONT       "-Misc-Stlarch-Medium-R-Normal--10-100-75-75-C-80-ISO10646-1", \
                       "-*-terminus-medium-r-normal-*-12-*-*-*-c-*-iso10646-1"
v2punkt0 wrote:
c00kiemon5ter wrote:

The script is no much different, two new values are added at the start of the line
indicating the screen id and the whether that screen is the currently focused one.
take a look in http://gist.github.com/c00kiemon5ter/1905427

I was using the one with the "monsterwm2dzen_with-titles_dwm-like" one but it makes a mess with my 2 monitors now.
Trying the other one for dzen2 it looks almost the same, here's a screenshot: http://i.imgur.com/ymEswew.png

when switching monitors it moves the "1s" from web to dev but that's it

ah, there isn't a xinerama example there hmm
try this (it is untested - just modified it on the fly)
notice the two new variables x and y (sorry for the bad naming tongue)

#!/usr/bin/env bash
 
# create a fifo to send output
ff="/tmp/monsterwm.fifo"
[[ -p $ff ]] || mkfifo -m 600 "$ff"
 
while read -r; do
    # filter output to only what we want to match and parse
    [[ $REPLY =~ ^(([[:digit:]]+:)+[[:digit:]]+ ?)+$ ]] && read -ra desktops <<< "$REPLY" || continue
    for desktop in "${desktops[@]}"; do
        # set values for
        # x - monitor id
        # y - if is current monitor
        # d - the desktop id
        # w - number of windows in that desktop
        # m - tiling layout/mode for that desktop
        # c - whether that desktop is the current (1) or not (0)
        # u - whether a window in that desktop has an urgent hint set (1) or not (0)
        IFS=':' read -r x y d w m c u <<< "$desktop"
 
        # name each desktop 
        case $d in
            0) d="web" s=""   ;;
            1) d="dev" s="::" ;;
            2) d="foo" s="::" ;;
            2) d="bar" s="::" ;;
        esac
 
        # color for unfocused desktops
        f="#5e7175"

        # color for the focused monitor's focused desktop
        # we will also display the current monitor's current desktop's tiling layout/mode
        ((y && c)) && f="#d11783" && case $m in
            # name each layout/mode with a symbol
            0) i="[T]" ;;
            1) i="[M]" ;;
            2) i="[B]" ;;
            3) i="[G]" ;;
        esac

        # the focused desktop of the unfocused monitor can be colored differently
        ((!y && c)) && f="#7e9195"
 
        # color for desktops with urgent hint
        ((u)) && f="#ff0000"
 
        # if the desktop has windows print that number next to the desktop name
        # else just print the desktop name
        # separate desktops based on their id (in case you want to handle them differently - ie hide one)
        if ((x == 1)); then ((w)) && desk1+="$s ^fg($f)$d $w^fg() " || desk1+="$s ^fg($f)$d^fg() "; fi
        if ((x == 2)); then ((w)) && desk2+="$s ^fg($f)$d $w^fg() " || desk2+="$s ^fg($f)$d^fg() "; fi
    done
 
    # output to dzen2
    printf "%s%s%s\n" "$desk1" "$desk2" "$i" && unset r
done < "$ff" | dzen2 -h 18 -w 400 -ta l -e -p -fn "-misc-terminusmod.icons-medium-r-normal--12-120-72-72-c-60-*-*" &

# pass output to fifo
monsterwm > "$ff"

Last edited by c00kiemon5ter (2013-08-21 08:55:23)


.:[ git me! ] :.

Offline

#1309 2013-08-21 09:54:53

v2punkt0
Member
From: Germany
Registered: 2008-03-09
Posts: 6
Website

Re: monsterwm! ~ yet another tiny wm

c00kiemon5ter wrote:
F34R wrote:

I use terminus for bar , nope i not solved problem with dmenu and replaced via interrobang.

terminus doesn't have the japanese glyphs iirc, so you may want to add a font in the FONT line in bar's config.h, so that it will fallback to that font to search for those glyphs.


Can I have more than two font ? artwiz & terminus font set in config.h.

I use the following to get the "icons" from stlarch and everything else from terminus

#define BAR_FONT       "-Misc-Stlarch-Medium-R-Normal--10-100-75-75-C-80-ISO10646-1", \
                       "-*-terminus-medium-r-normal-*-12-*-*-*-c-*-iso10646-1"
v2punkt0 wrote:
c00kiemon5ter wrote:

The script is no much different, two new values are added at the start of the line
indicating the screen id and the whether that screen is the currently focused one.
take a look in http://gist.github.com/c00kiemon5ter/1905427

I was using the one with the "monsterwm2dzen_with-titles_dwm-like" one but it makes a mess with my 2 monitors now.
Trying the other one for dzen2 it looks almost the same, here's a screenshot: http://i.imgur.com/ymEswew.png

when switching monitors it moves the "1s" from web to dev but that's it

ah, there isn't a xinerama example there hmm
try this (it is untested - just modified it on the fly)
notice the two new variables x and y (sorry for the bad naming tongue)

#!/usr/bin/env bash
 
# create a fifo to send output
ff="/tmp/monsterwm.fifo"
[[ -p $ff ]] || mkfifo -m 600 "$ff"
 
while read -r; do
    # filter output to only what we want to match and parse
    [[ $REPLY =~ ^(([[:digit:]]+:)+[[:digit:]]+ ?)+$ ]] && read -ra desktops <<< "$REPLY" || continue
    for desktop in "${desktops[@]}"; do
        # set values for
        # x - monitor id
        # y - if is current monitor
        # d - the desktop id
        # w - number of windows in that desktop
        # m - tiling layout/mode for that desktop
        # c - whether that desktop is the current (1) or not (0)
        # u - whether a window in that desktop has an urgent hint set (1) or not (0)
        IFS=':' read -r x y d w m c u <<< "$desktop"
 
        # name each desktop 
        case $d in
            0) d="web" s=""   ;;
            1) d="dev" s="::" ;;
            2) d="foo" s="::" ;;
            2) d="bar" s="::" ;;
        esac
 
        # color for unfocused desktops
        f="#5e7175"

        # color for the focused monitor's focused desktop
        # we will also display the current monitor's current desktop's tiling layout/mode
        ((y && c)) && f="#d11783" && case $m in
            # name each layout/mode with a symbol
            0) i="[T]" ;;
            1) i="[M]" ;;
            2) i="[B]" ;;
            3) i="[G]" ;;
        esac

        # the focused desktop of the unfocused monitor can be colored differently
        ((!y && c)) && f="#7e9195"
 
        # color for desktops with urgent hint
        ((u)) && f="#ff0000"
 
        # if the desktop has windows print that number next to the desktop name
        # else just print the desktop name
        # separate desktops based on their id (in case you want to handle them differently - ie hide one)
        if ((x == 1)); then ((w)) && desk1+="$s ^fg($f)$d $w^fg() " || desk1+="$s ^fg($f)$d^fg() "; fi
        if ((x == 2)); then ((w)) && desk2+="$s ^fg($f)$d $w^fg() " || desk2+="$s ^fg($f)$d^fg() "; fi
    done
 
    # output to dzen2
    printf "%s%s%s\n" "$desk1" "$desk2" "$i" && unset r
done < "$ff" | dzen2 -h 18 -w 400 -ta l -e -p -fn "-misc-terminusmod.icons-medium-r-normal--12-120-72-72-c-60-*-*" &

# pass output to fifo
monsterwm > "$ff"

thanks for the try but it doesn't work sad
maybe someone who uses the xinerama-master branch could share his, that would be awesome.

ps: any reason there's no menucmd in xinerama-master's config.h? i just added it myself and it works fine. (only showing dmenu on the first monitor but i can live with that)

Last edited by v2punkt0 (2013-08-21 10:44:32)

Offline

#1310 2013-08-21 11:09:06

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

There are many examples on the previous pages, I'm not home atm, when I return I could look into what I missed on the above example.
No special reason, other than an accidental omission I guess (I myself don't use dmenu).


.:[ git me! ] :.

Offline

#1311 2013-08-21 13:27:41

robstwd
Member
From: Brisbane
Registered: 2010-10-31
Posts: 32

Re: monsterwm! ~ yet another tiny wm

Greetings,

I am a very contented monsterwm user over the last year or so and have recently migrated to the wmrun.sh & statusinfo.sh style of monsterwm invocation, as found on c00kiemon5ter's github site (thanks c00kiemon5ter!). I have kept things pretty simple with just the master branch of monsterwm, piping the status info into bipolarbar (courtesy of moetunes - thanks also!). The left hand status info is derived from statusinfo.sh and the right hand status info is derived from a c program I cobbled together (adapted largely from an example from moetunes, I think). It is all working nicely.

I am now looking to incorporate the windowstitles branch and getting the appropriate window title info into the bar is where I'm getting stuck. A little nudge in the right direction would be greatly appreciated as my understanding of this stuff is pretty rudimentary!

For reference, my working set up before doing anything for windowtitles is:
1) boot to console & run startx
2) ~/.xinitrc contains => exec "$HOME/bin/wmrun.sh"
3) wmrun.sh - found on gist here https://gist.github.com/robstwd/6293733
4) statusinfo.sh - found on gist here https://gist.github.com/robstwd/6265773

Screenshot of the working "before" status bar here http://i.imgur.com/68ioJfQ.png

What I have done so far to migrate to windowtitles branch:
1) incorporated windowtitles branch (following c00kiemon5ter's guidance on the arch boards some time back):

$ git cherry-pick origin/windowtitles
$ make
$ sudo make install

2) wmrun.sh - unchanged
3) statusinfo.sh - added a few window title related elements as found on c00kiemon5ter's github site - my version on gist here https://gist.github.com/robstwd/6293918
changes indicated by "<=== ADDED"

Problem
The result is that the window title is found twice, even though it is expected only once:
1) in the expected position after the layout mode, in abbreviated form of the applications name (ie 'Geany')
2) and the unexpected manner with the fuller description ('wmrun.sh - /home/rob/bin - Geany') but the first part seems to be behind the desktop tags and pushes out the layout mode to the right. The text also seems to be expanded, or at least the spaces are.
That probably makes no sense, so here's a screen shot: http://i.imgur.com/CVGy6N4.png

Digging around:
1) the output of 'cat /tmp/monsterwm.fifo' seems to be what is expected from the various branches:
=> master branch, typical output in this format => "0:1:0:0:0 1:0:0:0:0 2:0:0:0:0 3:0:0:1:0"
=> with windowtitles branch, typical output in this format => "0:0:3:0:0 1:2:0:1:0 2:0:0:0:0 3:0:0:0:0|wmrun.sh - /home/rob/bin - Geany"

2) when restarting monsterwm when using the windowtitles branch, a few errors are noticed in the tty output such as "integer expression expected" identifying the problem at lines for each occurrence of the shell test statements ( [ $c -eq o ] etc). These errors do not appear when restarting on just the master branch.

3) narrowing down the statusinfo.sh output - the problem appears to be related to the $deskinfo variable only as just printing that alone shows the problem identified above. Not displaying it (ie only printing $layout or $title does not show the problem). I have fiddled with a number of permutations of the deskinfo="$deskinfo$bg$fg  $d  " and nothing I do seems to remove the unwanted duplication of the window title.

4) I have commented out the running of my c program from wmrun.sh for the right hand status info ('bipolarbar_status &') without any impact on the problem; so I am concluding that this is not contributing to the unwanted display.

5) The unwanted window title appears with apps I generally use except for leafpad!

I have not yet attempted to run another bar such as LemonBoy's as I am fairly attached to bipolarbar, but I guess that is an option.

So what I am hoping for:
1) removal of duplicated window title
2) the window title where I want it; at least the abbreviated title, or optionally the full name

Thanks for reading and for any help that may be offered. smile

Offline

#1312 2013-08-21 14:02:27

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

hello smile try this (also untested - not home yet):

remove the first line you added

    title="${desk#0}"                    # window title   (<== ADDED THIS)

and add this to the start of the file (ie line 7)

line="$@"
title="${line#*|}"
set -- ${line%%|*}

from then on everything should happen as it would if there were no title string in the desktop info line
the title should be in the title variable, so at the end (the other ADDED line) you print it where you want it


.:[ git me! ] :.

Offline

#1313 2013-08-21 20:45:05

robstwd
Member
From: Brisbane
Registered: 2010-10-31
Posts: 32

Re: monsterwm! ~ yet another tiny wm

Thank you so much c00kiemon5ter for your very fast attention. smile smile Talk about hitting the nail perfectly on the head!! Wonderful - exactly as I wanted.

So, just trying to really understand this - I get the addition of first 2 lines (you know, makes sense when the obvious is pointed out to you). But I am struggling with the third:

set -- ${line%%|*}

The man page for set refers to this structure as unsetting the variable; I can see what it does when commented out  - it's just I cannot figure out how it is doing that. I'll need to examine the man page much closer to make sense of it (currently off to work). In the meantime, would you mind summarising how that line works? thanks heaps

Offline

#1314 2013-08-21 21:24:29

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

wink It is re-setting the arguments that the script received. so,

set -- a b c
echo $1 # prints a
echo $3 # prints c

the loop that follows has no struct to iterate over
such a loop iterates over the script arguments, so

set -- a b c
for i; do echo "$i"; done # will print a b c each in its own line

to sum up, it removes the title from the arguments
and the rest of the script can behave as if the title was never there
without any change needed.


also this:

man set wrote:

       The special argument "--" immediately following the set command name can  be  used  to  delimit  the
       arguments  if  the  first  argument begins with '+' or '-', or to prevent inadvertent listing of all
       shell variables when there are no arguments. The command set -- without  argument  shall  unset  all
       positional parameters and set the special parameter '#' to zero.

----------------------------------------------------------------------------------------------------

v2punkt0 wrote:

thanks for the try but it doesn't work sad
maybe someone who uses the xinerama-master branch could share his, that would be awesome.

oh, I think what's missing is clearing the vars
from the above code examle replace

    # output to dzen2
    printf "%s%s%s\n" "$desk1" "$desk2" "$i" && unset r

with

    # output to dzen2
    printf "%s%s%s\n" "$desk1" "$desk2" "$i" && unset desk1 desk2

Last edited by c00kiemon5ter (2013-08-21 21:33:52)


.:[ git me! ] :.

Offline

#1315 2013-08-21 22:07:41

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

btw, regarding xkill, it want WM_STATE set for each window.
If one looks at the source code, the "problematic" function is 'wm_state_set' on the check on line 215

if (! wm_state_set(dpy, id) && wm_running(dpy, screenno))

This is all skipped with the -frame switch.

However, the functionality does not seem much different that monsterwm's killclient (by default Mod1+Shift+C)


.:[ git me! ] :.

Offline

#1316 2013-08-21 22:42:54

v2punkt0
Member
From: Germany
Registered: 2008-03-09
Posts: 6
Website

Re: monsterwm! ~ yet another tiny wm

c00kiemon5ter wrote:

wink It is re-setting the arguments that the script received. so,
----------------------------------------------------------------------------------------------------

v2punkt0 wrote:

thanks for the try but it doesn't work sad
maybe someone who uses the xinerama-master branch could share his, that would be awesome.

oh, I think what's missing is clearing the vars
from the above code examle replace

    # output to dzen2
    printf "%s%s%s\n" "$desk1" "$desk2" "$i" && unset r

with

    # output to dzen2
    printf "%s%s%s\n" "$desk1" "$desk2" "$i" && unset desk1 desk2

that fixes certainly the ugliness, now the problem is only showing stats for the second monitor. here's an example screenshot (sorry, i'm just no good at fiddling around with it myself sad) -> http://i.imgur.com/WG7Oi1S.png

any ideas?

edit: fixed it by editing the "if monitor id 1" bit, seems it's working with monitor id 0 and 1 rather than 1 and 2.
thanks a ton for your time and help! smile

Last edited by v2punkt0 (2013-08-21 22:46:35)

Offline

#1317 2013-08-21 22:51:24

robstwd
Member
From: Brisbane
Registered: 2010-10-31
Posts: 32

Re: monsterwm! ~ yet another tiny wm

c00kiemon5ter wrote:

wink It is re-setting the arguments that the script received. so,

set -- a b c
echo $1 # prints a
echo $3 # prints c

the loop that follows has no struct to iterate over
such a loop iterates over the script arguments, so

set -- a b c
for i; do echo "$i"; done # will print a b c each in its own line

to sum up, it removes the title from the arguments
and the rest of the script can behave as if the title was never there
without any change needed.


also this:

man set wrote:

       The special argument "--" immediately following the set command name can  be  used  to  delimit  the
       arguments  if  the  first  argument begins with '+' or '-', or to prevent inadvertent listing of all
       shell variables when there are no arguments. The command set -- without  argument  shall  unset  all
       positional parameters and set the special parameter '#' to zero.

Thanks again c00kie - you have been a great help smile smile

Offline

#1318 2013-08-22 21:09:12

Unia
Member
From: The Netherlands
Registered: 2010-03-30
Posts: 2,471
Website

Re: monsterwm! ~ yet another tiny wm

In my latest commit to DFWM (my MWM spinoff), I implemented support for the client state so you can use the "normal" (at least, how I use it tongue) xkill. If you want this added into MonsterWM, this commit will show you what to do:

https://github.com/Unia/dragonflywm/com … f9bfc2b333

EDIT: The code was already there, but commented out. Anyway, it still shows what to do. Thanks to both Cookie and DWM, whose code I copied.

Last edited by Unia (2013-08-22 21:10:24)


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

Offline

#1319 2013-08-25 07:52:18

F34R
Member
From: /dev/loliland
Registered: 2012-02-05
Posts: 238

Re: monsterwm! ~ yet another tiny wm

I try again dmenu implent in monsterwm. make script to run the launcher. Shell contain this line :

dmenu_run -f -i -l 12 -p 'lolicomplex' -nb #101010 -sb #7D3022 -sf #808080 -fn 'terminus2'

btw i run dmenu.sh say

usage: dmenu [-b] [-f] [-i] [-g] [-l lines] [-p prompt] [-fn font]         
             [-nb color] [-nf color] [-sb color] [-sf color] [-si index] [-is size] [-v]

that prompt working directly write in terminal.  original dmenu is horrible grey background and blueish selbgcolor : S

Last edited by F34R (2013-08-25 07:53:08)

Offline

#1320 2013-08-25 10:50:05

Unia
Member
From: The Netherlands
Registered: 2010-03-30
Posts: 2,471
Website

Re: monsterwm! ~ yet another tiny wm

You don't need a shell script for dmenu, you can configure everything from config.h:

static const char *dmenu[]    = { "dmenu_run", "-f", "-i", "-l", "12", "-p", "lolicomplex", "-nb", "#101010", "-sb", "#7D3022", "-fn", "terminus2", NULL };
...
{  MOD1,             XK_r,             spawn,          {.com = dmenu}},

If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

Offline

#1321 2013-08-26 09:06:28

el mariachi
Member
Registered: 2007-11-30
Posts: 587

Re: monsterwm! ~ yet another tiny wm

c00kiemon5ter wrote:

yes, it looks ok and works ok. AFAIU, the misplaced mouse and focus
problem hasn't been happening from the begining. Can you remember
what you might have updated or changed when it started ?
Could it be somethng you added in your .xinitrc ?

I tried a vanilla xinitrc with just "exec monsterwm" in it, and the same thing happens. I can't really pinpoint a time when this started to happen, but I've been through a couple of fresh installs and the issue has always remained. I'll try a more vanilla config.h and see what happens. Thanks!

Offline

#1322 2013-08-30 10:53:51

F34R
Member
From: /dev/loliland
Registered: 2012-02-05
Posts: 238

Re: monsterwm! ~ yet another tiny wm

Can i set transmission status in info script ? I finded this row how to convert into statusinfo.sh ?

print_torrent_status() {
  torrent_status="$(transmission-remote -l | awk -F " +" '$5 ~ /^[0-9]/ {print $5}')"
  if [[ ! $torrent_status ]]; then
torrent_status="Idle"
  fi
echo -ne "${colour_blk}${sep_solid}${colour_dylw} ${glyph_tor} ${torrent_status} "
}

Offline

#1323 2013-08-30 13:46:30

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

It's really easy, just call it in the same line that displays the time in the examples with
its own %s in the printf format string. That part of code should be in the same file.

Show us your statusinfo.sh

Last edited by c00kiemon5ter (2013-08-30 13:47:01)


.:[ git me! ] :.

Offline

#1324 2013-08-31 16:26:04

F34R
Member
From: /dev/loliland
Registered: 2012-02-05
Posts: 238

Re: monsterwm! ~ yet another tiny wm

c00kiemon5ter wrote:

It's really easy, just call it in the same line that displays the time in the examples with
its own %s in the printf format string. That part of code should be in the same file.

Show us your statusinfo.sh


Ohh well, I'm not good at scripting just merging from other monsterwm users. I try it btw only showed the download speed and i want a title and reaming time period.
Another question : in lemonboy bar colored underline only, how i added the color to icons ? (else will make custom dzen script ? )
Forgot  i use the Shinryuu statusinfo script.

here is the mine

Last edited by F34R (2013-08-31 16:29:07)

Offline

#1325 2013-08-31 17:50:37

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

Try this: http://sprunge.us/HJcf

#!/usr/bin/env sh

# expects a line from monsterwm's output as argument ("$1")
# prints formatted output to be used as input for bar
# reference: bar by LemonBoy -- https://github.com/LemonBoy/bar

# desktop status
for desk; do
	d="${desk%%:*}" desk="${desk#*:}" # desktop id
	w="${desk%%:*}" desk="${desk#*:}" # window count
	l="${desk%%:*}" desk="${desk#*:}" # layout mode
	c="${desk%%:*}" desk="${desk#*:}" # is current desktop
	u="$desk"                         # has urgent hint

	# desktop id
	case "$d" in
		0) d="  term" ;; 1) d="  web" ;;
		2) d="  japan " ;; 3) d="  files " ;;
	esac

	# current desktop
	if [ $c -ne 0 ]
	then bg="\b7" un="\u6" fg="\f9"
		case "$l" in
			0) s="" ;; 1) s="" ;; 2) s="" ;;
			3) s="" ;; 4) s="" ;;
		esac && s="\b8\u8 $s \br\ur"
	fi

	# has urgent hint or no windows
	[ $u -ne 0 ] && un="\u2"
	[ $w -eq 0 ] && w="-"

	in="$in$bg$fg$un $d \f8[$w] \ur\br\fr"
	unset bg fg un
done

# torrent status
torrent_status="$(transmission-remote -l | awk -F " +" '$5 ~ /^[0-9]/ {print $5}')"
[ -z "$torrent_status" ] && torrent_status="Idle"

# music status
music=$(cmus-remote -Q | awk '$2 == "artist"{a=substr($0,12)} $2 == "title"{t=substr($0,11); exit} END{printf("%s - %s\n",a,t); exit(!t)}')
[ $? -ne 0 ] && mstat="" music="Not playing" || mstat=""

# volume status
if [ "$(amixer get Master | sed -nr '$ s:.*\[(.+)]$:\1:p')" == "off" ]
then vol="[m]" vstat="volume:"
else
	vol="$(amixer get PCM | sed -nr '$ s:.*\[(.+%)].*:\1:p')"
	if   [ "${vol%\%}" -le 10 ]; then vstat=""
	elif [ "${vol%\%}" -le 20 ]; then vstat="";
	else vstat=""; fi
fi

# window title
wname=$(xdotool getactivewindow getwindowname)

# cpu
cpu="$(cut -d " " -f 1-2 /proc/loadavg)" cpustat=""

# temp
temp="$(sensors | grep -P "(temp1)" | cut -b 16-19)" cputemp="$(echo -n $temp)" tempstat=""

# date and time
date="$(date +"%a %d %b %R")" dstat=""

# symbols
arrow=""

# left statusbar info
printf '\\l'
printf '%s ' "$in" "$arrow" "$s"

# center statusbar info
printf '\\c'
printf '\\b7\\u7 %s \\br\\ur\\fr' "$wname"

# right statusbar info
printf '\\r'
printf '\\b7\\u6\\f1 %s \\br\\ur\\fr %s ' \
	"$arrow"    "$torrent_status"         \
	"$mstat"    "$music"                  \
	"$cpustat"  "$cpu"                    \
	"$tempstat" "$cputemp"                \
	"$vstat"    "$vol"                    \
	"$dstat"    "$date"

# end of statusbar info
printf '\n'

.:[ git me! ] :.

Offline

Board footer

Powered by FluxBB