guest@dotshare [~/groups/wms/monster] $ ls Monsterware/ | cat

Monsterware (scrot)

Knakis Mar 31, 2014 (wms/monster)

.wmrun.sh(raw, dl)

SCROT

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/usr/bin/env bash

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

tags=('■' '■' '■' '■' '■')
layouts=('' '' '' '' '') 

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

function statusbar
{
    sdate=" \b0\f7\u0  \b0\f1\u0" date="$(date +"%H:%M")"

    music="$(mpc current -f "%artist% - [%title%|%file%]")"
    if [ -z "$music" ]; then
        music="" smusic=""
    else
        smusic="$(mpc | sed -rn '2s/\[([[:alpha:]]+)].*/\1/p')"
        [ "$smusic" == "paused" ] && smusic=" \b0\f6\u0  \b0\f1\u0" || smusic=" \b0\f6\u0  \b0\f1\u0"
    fi

    if [ "$(amixer get Master | sed -nr '$ s:.*\[(.+)]$:\1:p')" == "off" ]; then
        vol="" svol=""
    else
        vol="$(amixer get Master | sed -nr '$ s:.*\[(.+%)].*:\1:p')"
        if [ "${vol%\%}" -le 10 ]; then
            svol=" \b0\f6\u0  \b0\f1\u0"
        elif [ "${vol%\%}" -le 20 ]; then
            svol=" \b0\f6\u0  \b0\f1\u0"
        else
            svol=" \b0\f6\u0  \b0\f1\u0"
        fi
    fi

    mem=$(free -m | awk '/buffers\/cache/ {print $3 MB}')
    if [ $mem -ge 1500 ]; then
        mem="$mem MB" smem="\b0\f3\u0  \b0\f1\u3"
    elif [ $mem -ge 800 ]; then
        mem="$mem MB" smem="\b0\f6\u0  \b0\f1\u0"
    else
        mem=""
    fi

    win=$(xdotool getactivewindow getwindowname)

    echo -n "$win \r  $smem$mem$svol$vol$smusic$music$sdate$date "
}

while read -t "0.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="7" bg="2" lc="\u7 " rc=" \ur" && layout=${layouts[$m]} || fg="1" bg="0" lc=" " rc=" "
            # Has windows ?
            ((w == 1)) && ((! c)) &&
              fg="6" lc="\u0 " rc=" \ur"
            ((w == 2)) && ((! c)) &&
              fg="5" lc="\u0 " rc=" \ur"
            ((w == 3)) && ((! c)) &&
              fg="4" lc="\u0 " rc=" \ur"
            ((w >= 4)) && ((! c)) &&
              fg="3" lc="\u0 " rc=" \ur"
            # Urgent windows ?
            ((u)) && fg="3" bg="1" lc="\u3 " rc=" \ur"

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

$wm > "$ff"

rm $ff

CLICK TO VIEW

x

config.h_wm(raw, dl)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/* 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    19        /* 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_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    3         /* window border width */
#define FOCUS           "#6F6F6F" /* focused window border color    */
#define UNFOCUS         "#0C0C0C" /* unfocused window border color  */
#define MINWSZ          50        /* minimum window size in pixels  */
#define DEFAULT_DESKTOP 0         /* the desktop to focus initially */
#define DESKTOPS        5         /* number of desktops - edit DESKTOPCHANGE keys to suit */
#define USELESSGAP      10         /* the size of the useless gap in pixels */

/**
 * open applications to specified desktop with specified mode.
 * if desktop is negative, then current is assumed
 */
static const AppRule rules[] = { \
    /*  class      desktop  follow  float */
    { "MPlayer",      4,    True,   False },
    { "Firefox",      3,    False,  False },
    { "Gimp",         4,    False,  True  },
    { "Scratchpad",  -1,    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[] = { "xterm",     NULL }; */
static const char *menucmd[] = { "dmenu_run", NULL };

#define DESKTOPCHANGE(K,N) \
    {  MOD1,             K,              change_desktop, {.i = N}}, \
    {  MOD1|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}},
    {  MOD1|SHIFT,       XK_c,          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|SHIFT,             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 */
/** {  MOD1,             XK_Return,     spawn,             {.com = termcmd}},
    {  MOD4,             XK_v,          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_1,                             0)
       DESKTOPCHANGE(    XK_2,                             1)
       DESKTOPCHANGE(    XK_3,                             2)
       DESKTOPCHANGE(    XK_4,                             3)
       DESKTOPCHANGE(    XK_5,                             4)
};

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

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

x

config.h_Bar(raw, dl)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* 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 "-*-stlarch-*-*-*-*-*-*-*-*-*-*-*-*","-*-termsynu-medium-*-*-*-*-*-*-*-*-*-*-*"
/* Some fonts don't set the right width for some chars, pheex it */
#define BAR_FONT_FALLBACK_WIDTH 6
/* Color palette */
#define COLOR0  0x1A1A1A /* background */
#define COLOR1  0xA9A9A9 /* foreground */
#define COLOR2  0x303030
#define COLOR3  0xF92672
#define COLOR4  0xA6E22E
#define COLOR5  0xFD971F
#define COLOR6  0x66D9EF
#define COLOR7  0x9E6FFE
#define COLOR8  0xAF875F
#define COLOR9  0xCCCCC6
 

x

.xinitrc(raw, dl)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

WM=/home/knakis/.wmrun.sh
userresources=$HOME/.Xresources

if [ -f $userresources ]; then
  /usr/bin/xrdb -merge $userresources
fi

export GTK_RC_FILES="$HOME/.gtkrc-2.0"

setxkbmap -layout ch -variant fr
xset +fp $HOME/.fonts
sh ~/.fehbg
urxvtd &
redshift -l 8.8383:13.2344 &

if [ -z "$DESKTOP_SESSION" -a -x /usr/bin/ck-launch-session ]; then
  exec ssh-agent ck-launch-session dbus-launch --exit-with-session $WM
else
  exec ssh-agent dbus-launch --exec-with-session $WM
fi
 

x

sxhkdrc(raw, dl)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
alt + Return
    urxvtc

super + v
    $HOME/Scripts/dmenu_run.sh

alt + x
    xdotool search --onlyvisible --classname Scratchpad windowunmap || xdotool search --classname Scratchpad windowmap || urxvtc -name Scratchpad -title Scratchpad -e screen &

Print
    import -w root $HOME/Pictures/bureau-$(date +"%F").jpg

XF86AudioPlay
    ncmpcpp toggle
XF86AudioPrev
    ncmpcpp prev
XF86AudioNext
    ncmpcpp next
XF86AudioStop
    ncmpcpp stop
XF86AudioMute
    amixer set Master toggle
XF86AudioLowerVolume
    amixer set Master 5%-
XF86AudioRaiseVolume
    amixer set Master 5%+
 

x

Notes

Monsterwm with uselessgaps and monocleborders patch.

http://image.noelshack.com/fichiers/2014/13/1396209788-mon-gif.gif

Comments

nounoursheureux said about 3 years ago

C'est quoi le logiciel qui affiche plein de lettres ?

What’s this software which prints lots of characters ?

Knakis said about 3 years ago