You are not logged in.

#1026 2012-10-13 11:44:37

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

Re: monsterwm! ~ yet another tiny wm

well, this is not something that monsterwm outputs.
something you are trying to launch returns this.
do things work ? what apps are you running ?


.:[ git me! ] :.

Offline

#1027 2012-10-13 11:57:24

nperry
Member
Registered: 2010-05-16
Posts: 87

Re: monsterwm! ~ yet another tiny wm

c00kiemon5ter wrote:

well, this is not something that monsterwm outputs.
something you are trying to launch returns this.
do things work ? what apps are you running ?

I've just re-ran it then looked at ps aux, for some reason there is a lot of monsterwm spawning. I don't launch/run any key shortcut to do this. Just "startx"

.xinitrc

#!/bin/bash

CRT=$(xrandr | grep "VGA1 connected")

if [ -n "$CRT" ]; then
	xrandr --output HDMI1 --off --output LVDS1 --mode 1366x768 --pos 1440x132 --rotate normal --output DP1 --off --output VGA1 --mode 1440x900 --pos 0x0 --rotate normal &
fi

# Screen Settings.
xset +dpms &
xset dpms 3600 0 0 &
xbacklight -set 10 &

# Xresources.
[[ -e $HOME/.Xresources ]] && xrdb ~/.Xresources &

# Fonts.
xset +fp /usr/share/fonts/local
xset fp rehash

# Java.
wmname LG3D &

# AutoCutSel.
autocutsel -fork &
autocutsel -selection PRIMARY -fork &

# Background
xsetroot -solid "#595959"

#sh bin/dwm-status &
#exec dbus-launch dwm

exec dbus-launch bin/monsterwm

Offline

#1028 2012-10-13 12:05:46

gholen
Member
From: Göteborg
Registered: 2011-07-26
Posts: 73
Website

Re: monsterwm! ~ yet another tiny wm

Might

exec dbous-launh /path/to/monsterwm/launher/

work better?

Offline

#1029 2012-10-13 12:10:25

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

Re: monsterwm! ~ yet another tiny wm

I'm assuming 'bin/monsterwm' is the "monsterwm launcher" script from your previous post.
your settings seem fine to me, the only thing I have no clue what it's doing is 'dbus-launch'.

from what you say there should be monsterwm instances on Ctrl-Alt-{7,8,9,..}
if you close all other spawned monsterwm instances and get rid of 'dbus-launch' what happens ?


.:[ git me! ] :.

Offline

#1030 2012-10-13 12:10:25

nperry
Member
Registered: 2010-05-16
Posts: 87

Re: monsterwm! ~ yet another tiny wm

gholen wrote:

Might

exec dbous-launh /path/to/monsterwm/launher/

work better?

I forgot I have my ~bin before anything in my $PATH. My launched was called monsterwm so the launcher kept running the launcher. Stuck in a loop. Fixed now, my bad!

Offline

#1031 2012-10-13 12:13:46

gholen
Member
From: Göteborg
Registered: 2011-07-26
Posts: 73
Website

Re: monsterwm! ~ yet another tiny wm

nperry wrote:
gholen wrote:

Might

exec dbous-launh /path/to/monsterwm/launher/

work better?

I forgot I have my ~bin before anything in my $PATH. My launched was called monsterwm so the launcher kept running the launcher. Stuck in a loop. Fixed now, my bad!


Happends to all of us sometimes. smile

Offline

#1032 2012-10-13 12:23:08

nperry
Member
Registered: 2010-05-16
Posts: 87

Re: monsterwm! ~ yet another tiny wm

gholen wrote:
nperry wrote:
gholen wrote:

Might

exec dbous-launh /path/to/monsterwm/launher/

work better?

I forgot I have my ~bin before anything in my $PATH. My launched was called monsterwm so the launcher kept running the launcher. Stuck in a loop. Fixed now, my bad!


Happends to all of us sometimes. smile

Indeed it does sad

When I launch now it is showing the bar, however the bar has no output. When I go to launch a terminal it dumps me back to tty1.

Offline

#1033 2012-10-13 12:31:48

gholen
Member
From: Göteborg
Registered: 2011-07-26
Posts: 73
Website

Re: monsterwm! ~ yet another tiny wm

Here is my bar, might wanna have a look and see if you can adopt something.

#!/usr/bin/env bash

wm=monsterwm
ff="/tmp/$RANDOM.monsterwm.fifo"

tags=(' www' ' irc' ' term' ' scrap' '')
layouts=('' '' '' '' '')

[[ -p $ff ]] || mkfifo -m 600 "$ff"

function statusbar {
    # Date
    date=$(date +"%H:%M")
    # Memory usage
    mem=$(free -m | awk '/buffers\/cache/ {print $3 MB}')
    # Battery
    #bat=$(sh /home/gholen/bin/battery.sh)
    bat=$(acpi -b|awk 'sub(/,/,"") {print $3, $5}')
    # Volume
    vol=$(amixer get PCM | tail -n1 | sed -r 's/.*\[(.*)%\].*/\1/')
    # Music status
    #music="$(mpc current -f "%artist% - %title%")"
    #if [ -z "$music" ]; then music="stopped" mstat="\ue0ae"
    #else
    #mstat="$(mpc | sed -rn '2s/\[([[:alpha:]]+)].*/\1/p')"
    #[ "$mstat" == "paused" ] && mstat="\ue059" || mstat="\ue0aa"
    #fi
    # HDD
    root=$(df -h|awk '/root/ {print $5}')
    home=$(df -h|awk '/home/ {print $5}')

    echo "\r  \f6\\fr $bat \f6\\fr $root \f6\\fr $home \f6\fr $mem \f6\\fr $vol \f6\\fr $date "
}

while read -t 1 -r wmout || true; do
    if [[ $wmout =~ ^(([[:digit:]]+:)+[[:digit:]]+ ?)+$ ]]; then
        read -ra desktops <<< "$wmout"

        tmp=
        for desktop in "${desktops[@]}"; do
            IFS=':' read -r d w m c u <<< "$desktop"
            # Tags labels
            label=${tags[$d]}
            # Current desktop color and enclosing char (yes/no)
            ((c)) && fg="9" bg="2" lc="\u4 " rc=" \ur" && layout=${layouts[$m]} || fg="1" bg="0" lc=" " rc=" "
            # Has windows ?
            ((w)) && ((! c)) && fg="6" lc="\u6 " rc=" \ur"
            # Urgent windows ?
            ((u)) && fg="9" bg="3" lc="\u4 " rc=" \ur"

            tmp+="\f$fg\b$bg$lc$label$rc\fr\br"
        done
        # Merge the clients indications and the tile mode
        tmp+=" $layout"
    fi
    echo "$tmp $(statusbar)"
done < "$ff" | bar &

#while :; do "$wm" || break; done | tee -a "$ff"
$wm > "$ff"

rm $ff

Offline

#1034 2012-10-13 12:35:08

gholen
Member
From: Göteborg
Registered: 2011-07-26
Posts: 73
Website

Re: monsterwm! ~ yet another tiny wm

From what I can see, you forgot to put the formating string in echo.

    echo "\r  \f6\\fr $bat \f6\\fr $root \f6\\fr $home \f6\fr $mem \f6\\fr $vol \f6\\fr $date "

\r formats the string for right. You seem to have forgot that very detail. smile

Last edited by gholen (2012-10-13 12:58:00)

Offline

#1035 2012-10-13 12:59:38

nperry
Member
Registered: 2010-05-16
Posts: 87

Re: monsterwm! ~ yet another tiny wm

gholen wrote:

From what I can see, you forgot to put the formating string in echo.

    echo "\r  \f6\\fr $bat \f6\\fr $root \f6\\fr $home \f6\fr $mem \f6\\fr $vol \f6\\fr $date "

I have kind of got it working, but still not 100%.

1. It is now displaying the layout and label - but not displaying anything for the statusbar function.
2. I'm only able to open a windows on my laptop window however the bar shows on my external monitor. I'm unable to open anything on that monitor, using ALT+1 and ALT+2 doesn't change monitors..

monster (my launch script)

 #!/usr/bin/env bash

wm=monsterwm
ff="/tmp/monsterwm.fifo"

[[ -p $ff ]] || mkfifo -m 600 $ff

tags=('foo' 'www' 'term' 'im' 'bar')
layouts=("T" "M" "B" "G" "F")

function statusbar {
    #ram
    ram="$(free -mo | grep -P "Mem"  | awk '{ print int($3-$7-$6)"/"$2 }')"
    
    #battery
    battery="$(acpi | awk '{print $3" "$4}' | sed -r 's/%,/%/')"

    #wireless
    wireless_check="$(iwconfig wlan0 | grep "ESSID:off/any")"
    if [ -n "$wireless_check" ]; then
        wireless="$(echo "not connected")"
    else
        wireless="$(iwconfig wlan0 | grep ESSID | cut -d '"' -f 2)"
    fi

    #volume
    volume="$(amixer get Master,0 | egrep -o '[0-9]{1,3}%' | sed -e 's/%//' | tail -1)"

    #date
    date="$(date "+%a %d %B %H:%M")"
    
    echo "\r \f6\test\fr $date"
}

while read -t 1 -r wmout || true; do
    if [[ $wmout =~ ^(([[:digit:]]+:)+[[:digit:]]+ ?)+$ ]]; then
        read -ra desktops <<< "$wmout"

        for desktop in "${desktops[@]}"; do
            if (( ${desktop%%:*} == 0 )); then
                lmon+=( $desktop )
            elif (( ${desktop%%:*} == 1 )); then
                rmon+=( $desktop )
            fi
        done

        for ldesktop in "${lmon[@]}"; do
            IFS=':' read -r x y d w m c u <<< "$ldesktop"
            ((c)) && label="${tags[$d]}" layout="\\b7\\f0 ${layouts[$m]} \\b0\\f7"
        done
    fi
    echo "\\l$layout $label\\r\\f7$(statusbar)"
done < "$ff" | bar &

#while :; do "$wm" || break; done | tee -a "$ff"
$wm > "$ff"

rm $ff

config.h

/* see LICENSE for copyright and license */

#ifndef CONFIG_H
#define CONFIG_H

/** modifiers **/
#define MOD1            Mod1Mask    /* ALT key */
#define MOD4            Mod4Mask    /* Super/Windows key */
#define CONTROL         ControlMask /* Control key */
#define SHIFT           ShiftMask   /* Shift key */

/** generic settings **/
#define MASTER_SIZE     0.52
#define SHOW_PANEL      True      /* show panel by default on exec */
#define TOP_PANEL       True      /* False means panel is on bottom */
#define PANEL_HEIGHT    18        /* 0 for no space for panel, thus no panel */
#define DEFAULT_MODE    TILE      /* initial layout/mode: TILE MONOCLE BSTACK GRID FLOAT */
#define ATTACH_ASIDE    True      /* False means new window is master */
#define FOLLOW_WINDOW   False     /* follow the window when moved to a different desktop */
#define FOLLOW_MONITOR  False      /* follow the window when moved to a different monitor */
#define FOLLOW_MOUSE    False     /* focus the window the mouse just entered */
#define CLICK_TO_FOCUS  True      /* focus an unfocused window when clicked  */
#define FOCUS_BUTTON    Button3   /* mouse button to be used along with CLICK_TO_FOCUS */
#define BORDER_WIDTH    1         /* window border width */
#define FOCUS           "#c5c8c6" /* focused window border color   */
#define UNFOCUS         "#969896" /* unfocused window border color */
#define INFOCUS         "#9c3885" /* focused window border color on unfocused monitor */
#define MINWSZ          50        /* minimum window size in pixels */
#define DEFAULT_MONITOR 0         /* the monitor to focus initially */
#define DEFAULT_DESKTOP 0         /* the desktop to focus initially */
#define DESKTOPS        5         /* number of desktops - edit DESKTOPCHANGE keys to suit */

struct ml {
    int m; /* monitor that the desktop in on  */
    int d; /* desktop which properties follow */
    struct {
        int mode;  /* layout mode for desktop d of monitor m    */
        int masz;  /* incread or decrease master area in px     */
        Bool sbar; /* whether or not to show panel on desktop d */
    } dl;
};

/**
 * define initial values for each monitor and dekstop properties
 *
 * in the example below:
 * - the first desktop (0) on the first monitor (0) will have
 *   tile layout, with its master area increased by 50px and
 *   the panel will be visible.
 * - the third desktop (2) on the second monitor (1) will have
 *   grid layout, with no changes to its master area and
 *   the panel will be hidden.
 */
static const struct ml init[] = { \
    /* monitor  desktop   mode  masz  sbar   */
    {     0,       0,   { TILE,  50,  True  } },
    {     1,       1,   { TILE,  50,  True } },
};

/**
 * open applications to specified monitor and desktop
 * with the specified properties.
 * if monitor is negative, then current is assumed
 * if desktop is negative, then current is assumed
 */
static const AppRule rules[] = { \
    /*  class     monitor  desktop  follow  float */
    { "MPlayer",     0,       3,    True,   False },
    { "Gimp",        1,       0,    False,  True  },
};

/* helper for spawning shell commands */
#define SHCMD(cmd) {.com = (const char*[]){"/bin/sh", "-c", cmd, NULL}}

/**
 * custom commands
 * must always end with ', NULL };'
 */
static const char *termcmd[] = { "urxvt", NULL };
static const char *menucmd[] = { "dmenu_run", NULL };

#define MONITORCHANGE(K,N) \
    {  MOD1,             K,              change_monitor, {.i = N}}, \
    {  MOD1|ShiftMask,   K,              client_to_monitor, {.i = N}},

#define DESKTOPCHANGE(K,N) \
    {  MOD4,             K,              change_desktop, {.i = N}}, \
    {  MOD4|ShiftMask,   K,              client_to_desktop, {.i = N}},

/**
 * keyboard shortcuts
 */
static Key keys[] = {
    /* modifier          key            function           argument */
    {  MOD1,             XK_b,          togglepanel,       {NULL}},
    {  MOD1,             XK_BackSpace,  focusurgent,       {NULL}},
    {  MOD4,             XK_k,          killclient,        {NULL}},
    {  MOD1,             XK_j,          next_win,          {NULL}},
    {  MOD1,             XK_k,          prev_win,          {NULL}},
    {  MOD1,             XK_h,          resize_master,     {.i = -10}}, /* decrease size in px */
    {  MOD1,             XK_l,          resize_master,     {.i = +10}}, /* increase size in px */
    {  MOD1,             XK_o,          resize_stack,      {.i = -10}}, /* shrink   size in px */
    {  MOD1,             XK_p,          resize_stack,      {.i = +10}}, /* grow     size in px */
    {  MOD1|CONTROL,     XK_h,          rotate,            {.i = -1}},
    {  MOD1|CONTROL,     XK_l,          rotate,            {.i = +1}},
    {  MOD1|SHIFT,       XK_h,          rotate_filled,     {.i = -1}},
    {  MOD1|SHIFT,       XK_l,          rotate_filled,     {.i = +1}},
    {  MOD1,             XK_Tab,        last_desktop,      {NULL}},
    {  MOD1,             XK_Return,     swap_master,       {NULL}},
    {  MOD1|SHIFT,       XK_j,          move_down,         {NULL}},
    {  MOD1|SHIFT,       XK_k,          move_up,           {NULL}},
    {  MOD1|SHIFT,       XK_t,          switch_mode,       {.i = TILE}},
    {  MOD1|SHIFT,       XK_m,          switch_mode,       {.i = MONOCLE}},
    {  MOD1|SHIFT,       XK_b,          switch_mode,       {.i = BSTACK}},
    {  MOD1|SHIFT,       XK_g,          switch_mode,       {.i = GRID}},
    {  MOD1|SHIFT,       XK_f,          switch_mode,       {.i = FLOAT}},
    {  MOD1|CONTROL,     XK_r,          quit,              {.i = 0}}, /* quit with exit value 0 */
    {  MOD1|CONTROL,     XK_q,          quit,              {.i = 1}}, /* quit with exit value 1 */
    {  MOD4,             XK_Return,     spawn,             {.com = termcmd}},
    {  MOD4,             XK_o,          spawn,             {.com = menucmd}},
    {  MOD4,             XK_j,          moveresize,        {.v = (int []){   0,  25,   0,   0 }}}, /* move down  */
    {  MOD4,             XK_k,          moveresize,        {.v = (int []){   0, -25,   0,   0 }}}, /* move up    */
    {  MOD4,             XK_l,          moveresize,        {.v = (int []){  25,   0,   0,   0 }}}, /* move right */
    {  MOD4,             XK_h,          moveresize,        {.v = (int []){ -25,   0,   0,   0 }}}, /* move left  */
    {  MOD4|SHIFT,       XK_j,          moveresize,        {.v = (int []){   0,   0,   0,  25 }}}, /* height grow   */
    {  MOD4|SHIFT,       XK_k,          moveresize,        {.v = (int []){   0,   0,   0, -25 }}}, /* height shrink */
    {  MOD4|SHIFT,       XK_l,          moveresize,        {.v = (int []){   0,   0,  25,   0 }}}, /* width grow    */
    {  MOD4|SHIFT,       XK_h,          moveresize,        {.v = (int []){   0,   0, -25,   0 }}}, /* width shrink  */
       DESKTOPCHANGE(    XK_F1,                             0)
       DESKTOPCHANGE(    XK_F2,                             1)
       DESKTOPCHANGE(    XK_F3,                             2)
       DESKTOPCHANGE(    XK_F4,                             3)
       DESKTOPCHANGE(    XK_F5,                             4)
       MONITORCHANGE(    XK_F1,                             0)
       MONITORCHANGE(    XK_F2,                             1)
};

/**
 * mouse shortcuts
 */
static Button buttons[] = {
    {  MOD1,    Button1,     mousemotion,   {.i = MOVE}},
    {  MOD1,    Button3,     mousemotion,   {.i = RESIZE}},
};
#endif

/* vim: set expandtab ts=4 sts=4 sw=4 : */

bar config.h

/* The height of the bar (in pixels) */
#define BAR_HEIGHT  18
/* The width of the bar. Set to -1 to fit screen */
#define BAR_WIDTH   -1
/* Offset from the left. Set to 0 to have no effect */
#define BAR_OFFSET 0
/* Choose between an underline or an overline */
#define BAR_UNDERLINE 1
/* The thickness of the underline (in pixels). Set to 0 to disable. */
#define BAR_UNDERLINE_HEIGHT 2
/* Default bar position, overwritten by '-b' switch */
#define BAR_BOTTOM 0
/* The fonts used for the bar, comma separated. Only the first 2 will be used. */
#define BAR_FONT       "-*-terminus-medium-r-normal-*-12-*-*-*-c-*-*-1","fixed"
/* Color palette */
#define COLOR1	0xd0d0d0
#define COLOR0	0x1a1a1a
#define COLOR2	0x1a1a1a
#define COLOR3	0xdf8787
#define COLOR4	0xafdf87
#define COLOR5	0xffffaf
#define COLOR6	0x87afdf
#define COLOR7	0xdfaf87
#define COLOR8	0xafafdf
#define COLOR9	0xd0d0d0

Offline

#1036 2012-10-13 13:18:18

gholen
Member
From: Göteborg
Registered: 2011-07-26
Posts: 73
Website

Re: monsterwm! ~ yet another tiny wm

DESKTOPCHANGE(    XK_F1,                             0)
       DESKTOPCHANGE(    XK_F2,                             1)
       DESKTOPCHANGE(    XK_F3,                             2)
       DESKTOPCHANGE(    XK_F4,                             3)
       DESKTOPCHANGE(    XK_F5,                             4)
       MONITORCHANGE(    XK_F1,                             0)
       MONITORCHANGE(    XK_F2,                             1)

Seems like you have two combos that are conflicting here? Alt+F1/ALT+F2 is the same for change monitorns and desktop.
Chanche to:

       DESKTOPCHANGE(    XK_F1,                             0)
       DESKTOPCHANGE(    XK_F2,                             1)
       DESKTOPCHANGE(    XK_F3,                             2)
       DESKTOPCHANGE(    XK_F4,                             3)
       DESKTOPCHANGE(    XK_F5,                             4)
       MONITORCHANGE(    XK_1,                             0) /*Monitor 1*/ 
       MONITORCHANGE(    XK_2,                             1) /*monitor 2*/

Last edited by gholen (2012-10-13 13:20:01)

Offline

#1037 2012-10-13 14:01:41

nperry
Member
Registered: 2010-05-16
Posts: 87

Re: monsterwm! ~ yet another tiny wm

gholen wrote:
DESKTOPCHANGE(    XK_F1,                             0)
       DESKTOPCHANGE(    XK_F2,                             1)
       DESKTOPCHANGE(    XK_F3,                             2)
       DESKTOPCHANGE(    XK_F4,                             3)
       DESKTOPCHANGE(    XK_F5,                             4)
       MONITORCHANGE(    XK_F1,                             0)
       MONITORCHANGE(    XK_F2,                             1)

Seems like you have two combos that are conflicting here? Alt+F1/ALT+F2 is the same for change monitorns and desktop.
Chanche to:

       DESKTOPCHANGE(    XK_F1,                             0)
       DESKTOPCHANGE(    XK_F2,                             1)
       DESKTOPCHANGE(    XK_F3,                             2)
       DESKTOPCHANGE(    XK_F4,                             3)
       DESKTOPCHANGE(    XK_F5,                             4)
       MONITORCHANGE(    XK_1,                             0) /*Monitor 1*/ 
       MONITORCHANGE(    XK_2,                             1) /*monitor 2*/

MONITORCHANGE is set MOD1 to and DESKTOPCHANGE is set to MOD4 so this shouldn't be conflicting.

Offline

#1038 2012-10-13 14:06:20

gholen
Member
From: Göteborg
Registered: 2011-07-26
Posts: 73
Website

Re: monsterwm! ~ yet another tiny wm

I'm unable to open anything on that monitor, using ALT+1 and ALT+2 doesn't change monitors..

Mistake by me perhaps, but you DID point to ALT/MOD1 instead of WIN/MOD4 smile

Anyhow, I really cant find the problem, c00ckiemon5ter might. I'm off to have a beer with best mate, so see ya around in a bit. Good luck!

Offline

#1039 2012-10-13 15:43:43

nperry
Member
Registered: 2010-05-16
Posts: 87

Re: monsterwm! ~ yet another tiny wm

gholen wrote:

I'm unable to open anything on that monitor, using ALT+1 and ALT+2 doesn't change monitors..

Mistake by me perhaps, but you DID point to ALT/MOD1 instead of WIN/MOD4 smile

Anyhow, I really cant find the problem, c00ckiemon5ter might. I'm off to have a beer with best mate, so see ya around in a bit. Good luck!

Thanks gholen, enjoy your beer!

Still having an issue with the status bar not showing anything but the layout and label. Also it is only ever showing the information for monitor 1, is there an example around showing how to ouput both monitors desktop and current layout?

my current status bar/launcher

#!/usr/bin/env sh

: "${wm:=monsterwm}"
: "${ff:="/tmp/${wm}.fifo"}"
[ -p "$ff" ] || mkfifo -m 600 "$ff"

tags=('foo' 'www' 'term' 'im' 'bar')
layouts=("T" "M" "B" "G" "F")

function statusbar {
	#ram
	ram="$(free -mo | grep -P "Mem"  | awk '{ print int($3-$7-$6)"/"$2 }')"
	 
	#battery
	battery="$(acpi | awk '{print $3" "$4}' | sed -r 's/%,/%/')"

	#wireless
	wireless_check="$(iwconfig wlan0 | grep "ESSID:off/any")"
	if [ -n "$wireless_check" ]; then
	    wireless="$(echo "not connected")"
	else
	    wireless="$(iwconfig wlan0 | grep ESSID | cut -d '"' -f 2)"
	fi

	#volume
	volume="$(amixer get Master,0 | egrep -o '[0-9]{1,3}%' | sed -e 's/%//' | tail -1)"

	#date
	date="$(date "+%a %d %B %H:%M")"

    echo "\r  $ram $volume $wireless $battery $date"
}

while read -t 1 -r wmout || true; do
    if [[ $wmout =~ ^(([[:digit:]]+:)+[[:digit:]]+ ?)+$ ]]; then
        read -ra desktops <<< "$wmout"

        for desktop in "${desktops[@]}"; do
            if (( ${desktop%%:*} == 0 )); then
                lmon+=( $desktop )
            elif (( ${desktop%%:*} == 1 )); then
                rmon+=( $desktop )
            fi
        done

        for ldesktop in "${lmon[@]}"; do
            IFS=':' read -r x y d w m c u <<< "$ldesktop"
            ((c)) && label="${tags[$d]}" layout="\\b7\\f0 ${layouts[$m]} \\b0\\f7"
        done
    fi
    echo "\\l$layout $label\\r\\f7$(statusbar)"
done < "$ff" | bar &

#while :; do "$wm" || break; done | tee -a "$ff"
$wm > "$ff"

rm $ff

Last edited by nperry (2012-10-13 15:56:56)

Offline

#1040 2012-10-13 17:54:17

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

Re: monsterwm! ~ yet another tiny wm

hi again,

so, first thing, your launcher script is using bash features,
so you should be using '#!/usr/bin/env bash' not 'sh'

after you process the info you output

echo "\\l$layout $label\\r\\f7$(statusbar)"

so it is indeed doing the right thing.

what is that you want to see on the status bar ?
if you want all desktop info, then you shouldn't use this script
but one like the ones on the gist


.:[ git me! ] :.

Offline

#1041 2012-10-13 19:52:43

nperry
Member
Registered: 2010-05-16
Posts: 87

Re: monsterwm! ~ yet another tiny wm

c00kiemon5ter wrote:

hi again,

so, first thing, your launcher script is using bash features,
so you should be using '#!/usr/bin/env bash' not 'sh'

after you process the info you output

echo "\\l$layout $label\\r\\f7$(statusbar)"

so it is indeed doing the right thing.

Got that, updated that thanks!

c00kiemon5ter wrote:

what is that you want to see on the status bar ?
if you want all desktop info, then you shouldn't use this script
but one like the ones on the gist

I want to see all desktop info. The current one only shows information for monitor 0.

I have tried the gist you linked to, it seems to be giving me an error.

bin/monster: line 39: ((: 0:1:0 syntax error in expression (error token is ":1:0")
bin/monster: line 39: ((: 0:0:0 syntax error in expression (error token is ":0:0")
bin/monster: line 39: ((: 0:0:0 syntax error in expression (error token is ":0:0")
bin/monster: line 39: ((: 0:0:0 syntax error in expression (error token is ":0:0")
bin/monster: line 39: ((: 0:0:0 syntax error in expression (error token is ":0:0")

Here is my launcher scritpt

Last edited by nperry (2012-10-13 20:16:09)

Offline

#1042 2012-10-13 20:32:00

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

Re: monsterwm! ~ yet another tiny wm

ah, that's because you're skipping the monitor id and the var that tells you if the monitor is the current one.
those vars are not there for single monitor setups.

on your launcher script, line 37

IFS=':' read -r d w m c u <<< "$desktop"

change to

IFS=':' read -r x y d w m c u <<< "$desktop"

where 'x' is the monitor id (ie '0' for first monitor, '1' for second, '2' for third etc)
and 'y' is the '1' if that monitor is the active one, or '0' if the monitor is inactive.
you can use those to display more information (ie have one color for the active desktop
on the active monitor and another for the active desktop on the inactive monitor).

you can check other people's settings,
ie Schoewilliam's or mine

Last edited by c00kiemon5ter (2012-10-13 20:34:33)


.:[ git me! ] :.

Offline

#1043 2012-10-13 21:38:38

nperry
Member
Registered: 2010-05-16
Posts: 87

Re: monsterwm! ~ yet another tiny wm

c00kiemon5ter wrote:

ah, that's because you're skipping the monitor id and the var that tells you if the monitor is the current one.
those vars are not there for single monitor setups.

on your launcher script, line 37

IFS=':' read -r d w m c u <<< "$desktop"

change to

IFS=':' read -r x y d w m c u <<< "$desktop"

where 'x' is the monitor id (ie '0' for first monitor, '1' for second, '2' for third etc)
and 'y' is the '1' if that monitor is the active one, or '0' if the monitor is inactive.
you can use those to display more information (ie have one color for the active desktop
on the active monitor and another for the active desktop on the inactive monitor).

you can check other people's settings,
ie Schoewilliam's or mine

Thanks for everyones help today, sorry for spamming smile

Got it all sorted, it has taken me a couple of hours but I have just pushed to my dotfiles repo a fully working launcher. Now to go have a look into for icons... What is the best font to use and how do I actually put these icons in..?

Last edited by nperry (2012-10-13 21:39:01)

Offline

#1044 2012-10-13 21:55:26

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

Re: monsterwm! ~ yet another tiny wm

I use stlarch font by Stlarch smile
the package is on aur named 'stlarch_font'

set that font to be used by your panel (ie bar)
and then just print the correct symbol

you can use gbdfed to view the font symbols


.:[ git me! ] :.

Offline

#1045 2012-10-13 22:04:21

nperry
Member
Registered: 2010-05-16
Posts: 87

Re: monsterwm! ~ yet another tiny wm

c00kiemon5ter wrote:

I use stlarch font by Stlarch smile
the package is on aur named 'stlarch_font'

set that font to be used by your panel (ie bar)
and then just print the correct symbol

you can use gbdfed to view the font symbols

How do I copy the font symbol from gdbfed to the script, when I copy one it just out puts char followed by the number.

Offline

#1046 2012-10-14 00:55:12

gholen
Member
From: Göteborg
Registered: 2011-07-26
Posts: 73
Website

Re: monsterwm! ~ yet another tiny wm

Use

echo -e '\(e if unicode)number of char)'

then copy that to script smile
In my case it would be

 echo -e '\e037'

for battery. Copy the symbol, and then paste it. Good luck!

Also, the beers where good. And some none-linux-peaple where inpressed by the work that monsterwm is.

Offline

#1047 2012-10-14 09:46:23

nperry
Member
Registered: 2010-05-16
Posts: 87

Re: monsterwm! ~ yet another tiny wm

gholen wrote:

Use

echo -e '\(e if unicode)number of char)'

then copy that to script smile
In my case it would be

 echo -e '\e037'

for battery. Copy the symbol, and then paste it. Good luck!

Also, the beers where good. And some none-linux-peaple where inpressed by the work that monsterwm is.

Doesn't seem to be working for me, Using termsyn as a font. Get the same result using " and '. http://i.imgur.com/s48zs.png

gholen wrote:

Also, the beers where good. And some none-linux-peaple where inpressed by the work that monsterwm is.

I'm impressed too just that my scripting skills aren't all that good! For some reason this morning I have logged and I have lost my status numbers from my bar again. I have narrowed it down to if I only plug one monitor in it shows on that monitor.
Also for some reason even though I have it set in my config.h that monitor1 sbar is false it always seems to get the bar, I'm not sure if this is linked.

Offline

#1048 2012-10-14 09:55:56

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

Re: monsterwm! ~ yet another tiny wm

I use either of those

$ echo -e "\uXXXX"
$ printf "%b" "\uXXXX"

where XXXX is the unicode above the symbol in gbdfed (ie 'E002')
I copy that and use it in the launcher directly in an echo or printf statement.

most probably when you do that, you'll get a rectangle (unknown character/glyph)
but if echo'ed on bar  (that should use the stlarch font) will render fine.

Last edited by c00kiemon5ter (2012-10-14 09:58:53)


.:[ git me! ] :.

Offline

#1049 2012-10-14 11:47:05

nperry
Member
Registered: 2010-05-16
Posts: 87

Re: monsterwm! ~ yet another tiny wm

c00kiemon5ter wrote:

I use either of those

$ echo -e "\uXXXX"
$ printf "%b" "\uXXXX"

where XXXX is the unicode above the symbol in gbdfed (ie 'E002')
I copy that and use it in the launcher directly in an echo or printf statement.

most probably when you do that, you'll get a rectangle (unknown character/glyph)
but if echo'ed on bar  (that should use the stlarch font) will render fine.

That did it.. all running nice now.

On my statusbar if I run

printf "\\\l%s\\\r%s\n" "$r\\f1$i" "$(statusbar)" 

The status bar doesn't show up on my two monitor setup, however if I run it as this 

printf "\\\l%s\\\r%s\n" "$r\\f1$i $(statusbar)" 

It shows up fine.

Not sure if you want to update the gist to show this?

Last edited by nperry (2012-10-14 11:47:40)

Offline

#1050 2012-10-16 14:50:34

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

Re: monsterwm! ~ yet another tiny wm

Hello,

I also decided to play around with MonsterWM. For now I'm just using the default branch, but once I think I could use it for longer periods of time I will try to combine the uselessgap branch with the initlayout one. (any tips to accomplish this easy? big_smile)

I'm using MonsterWM in combination with dzen2. I've found Cookie's gist that contains multiple scripts for each "bar" we can use, kudos! I have just two questions on this:
1. Can I somehow configure this so when I left-click the desktop name in dzen2, MonsterWM will switch to that desktop? I know dzen2 supports mouseclicks, I just need to know if there's some way I can use those to call Monster to switch desktop.
2. The separators and tiling layout indicator are a gray color. I don't have this specified in my script and would like these to be the normal foreground color. Where can I change this?

Oh - also, I have found that restarting Monster makes it crash. Is this known, or am I doing something wrong?

Last edited by Unia (2012-10-16 14:57:05)


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

Board footer

Powered by FluxBB