You are not logged in.

#376 2010-07-17 10:31:48

fifafrazer
Member
Registered: 2008-02-18
Posts: 74

Re: The wmii thread

I would like to see it LuX

Offline

#377 2010-07-18 15:40:58

valium97582
Member
Registered: 2010-06-19
Posts: 126

Re: The wmii thread

Me too, LuX. In which language is it implemented?


I'm also known as zmv on IRC.

Offline

#378 2010-07-19 10:51:57

LuX
Member
From: France
Registered: 2010-06-14
Posts: 49

Re: The wmii thread

Hi!

dengu wrote:
SoleSoul wrote:

Now the default layout is "stack". How can I change it back to "default"?

wmiir xwrite /ctl colmode default

Thank you dengu for this solution which I was looking for too, but please note that it doesn't fully work. As explained in /usr/share/doc/wmii/wmii.pdf, putting "wmiir xwrite /ctl colmode default" in your wmiirc makes the default layout to be "default" only for newly created columns, not for the initial one. You have to put in your wmiirc (for example in the beginning of it, just after "# Column rules") the following two commands:

wmiir xwrite /ctl colmode default                                                                   
wmiir xwrite /tag/sel/ctl colmode sel default

Regards,
LuX.

Offline

#379 2010-07-19 14:30:06

LuX
Member
From: France
Registered: 2010-06-14
Posts: 49

Re: The wmii thread

Hi!

valium97582 wrote:

Me too, LuX. In which language is it implemented?

It is just a few command lines in the wmiirc file, hence a part of a dash script.

------  EDIT  ------
1) Instead of editing wmiirc, it is recommanded by Kris Maglione to use wmiirc_local.
Thus I have modified the method in order to use only ~/.wmii/wmiirc_local and the default /etc/wmii/wmiirc.

2) The first method given below uses pmount to mount USB pens instead of thunar-volman, the volume manager shipped with Thunar. This is nice if you don't want to use thunar-volman (for example because you actually use another file manager). On the other hand if you're really using Thunar it is much better to use thunar-volman instead of pmount: because it avoids an unnecessary dependence, but most of all because a USB pen mounted with pmount cannot be unmounted inside Thunar with thunar-volman, which is a pain. Thus I have been looking for a second method, which I also report below, in order to replace pmount with thunar-volman.

3) According to Kris Maglione there exists at least one more method which avoids both using pmount and any file manager. It consists in mounting USB pens only by mean of hal and dbus-send (see here). I had some issue when I tried to use it, but it is pretty interesting though and I rubbed some ideas there for my second method.

4) Alltogether, this makes a pretty long post!  wink
-----------------------

From now on, I assume that you are using wmii-3.9.2, and your ~/.wmii directory only contains history files and possibly a wmiirc_local file. The following two possible ~/.wmii/wmiirc_local files will then give to wmii a basic ability to deal with USB pens as described in my post #377.

WARNING: After the USB pen is plugged in it might take some time (5 to 10 seconds on my relatively slow laptop) until it appears on the right bar. Be patient!

Method 1

Uses pmount (must be installed with pacman) + an arbitrary (optionnal) file manager

Note: The (remove|create|update)StatusBars functions above and the status action which calls them are a nice trick posted earlier in this thread by Alexandrite, in order to easily add to the right bar several interactive buttons devoted to various tasks.

For sake of simplicity the minimal wmiirc_local file that I'm posting here only creates one button for displaying time, and the buttons needed to manage usb pens. However in my own wmiirc_local file I have added other interactive buttons, and in order to control easily their order in the right bar I always give them names starting with a two digit number (like the udev rules). This is the reason why the name of the buttons created by checkUSB start with '60usb-' instead of simply 'usb-' or anything else, and of course this trick is not at all mandatory.

### Useful functions

# Status bars
# (functions called by the 'status' action)
removeStatusBars() {
    for i in $(wmiir ls /rbar); do
        if [ "/rbar/$i" != "$noticebar" ]; then 
            wmiir remove /rbar/$i
        fi
    done
}

createStatusBars() {
    echo "$WMII_NORMCOLORS" | wmiir create /rbar/90time
}

updateStatusBars() {
    echo -n "$(date +'%T')" | wmiir write /rbar/90time
    checkUSB
}

# Manage USB pens
checkUSB() {
    local usbdev
    # create a button and pmount usb pens when plugged in
    for i in $(ls -1 /dev/disk/by-id 2> /dev/null); do
        if [ "$i" != "${i##usb-}" ]; then
            usbdev="$(ls -l /dev/disk/by-id/$i)"
            usbdev=${usbdev##*/}
            if [ -z "$(wmiir ls /rbar | grep 60usb-$usbdev)" ]; then
                if pmount $usbdev ; then
                    echo -n "$WMII_FOCUSCOLORS $usbdev" | wmiir create /rbar/60usb-$usbdev
                    thunar /media/$usbdev &    # You can replace thunar by pcmanfm or anything else
                fi
            fi
        fi
    done
    # focus/unfocus/remove the buttons when the usb pens are
    # mounted/unmounted/unplugged
    for i in $(wmiir ls /rbar); do
        usbdev="${i##60usb-}"
        if [ "$usbdev" != "$i" ]; then
            if [ ! -e /dev/$usbdev ]; then
                wmiir remove /rbar/60usb-$usbdev
            elif [ -n "$(mount | grep /dev/$usbdev\ )" ]; then
                echo -n "$WMII_FOCUSCOLORS $usbdev" | wmiir write /rbar/60usb-$usbdev
            else
                echo -n "$WMII_NORMCOLORS $usbdev" | wmiir write /rbar/60usb-$usbdev
            fi
        fi
    done
}

### Events

local_events() {
    cat <<'!'

# Bar clicks
Event RightBarClick
    shift
    case "$@" in
    60*)
        if [ -z "$(pmount | grep /dev/${@##60usb-}\ )" ]; then
            pmount /dev/${@##60usb-}
        else
                echo -n "$WMII_NORMCOLORS ${@##60usb-}" | wmiir write /rbar/$@
        fi ;;
    esac

# Actions
Action status
    set +xv
    if removeStatusBars 2>/dev/null; then
        true
    fi
    createStatusBars
    while updateStatusBars; do
            sleep 1
    done
!
}

Method 2 (my favourite lol)

Uses thunar-volman to mount USB pens, hal and dbus-sent to unmount them (and to check whether or not they are mounted) + an arbitrary file manager (but since thunar-volman is mandatory, thunar is the most natural here).

Note: The same 'note' as in the method 1 is valid for this second method too.

Important! In order to give to thunar the possiblity to manage volume (by mean of thunar-volman) it is necessary that you start wmii together with a ck-launch-session. Thus your .xinitrc file should typically contain:

until ck-launch-session wmii; do
    true
done

instead of the classical:

until wmii; do
    true
done

Now here is the alternate wmiirc_local file to put in ~/.wmii:

### Useful functions

# Status bars
# (functions called by the 'status' action)
removeStatusBars() {
    for i in $(wmiir ls /rbar); do
        if [ "/rbar/$i" != "$noticebar" ]; then 
            wmiir remove /rbar/$i
        fi
    done
}

createStatusBars() {
    echo "$WMII_NORMCOLORS" | wmiir create /rbar/90time
}

updateStatusBars() {
    echo -n "$(date +'%T')" | wmiir write /rbar/90time
    checkUSB
}

# Manage USB pens
checkUSB() {
    local dev
    local udi
    # create a button and mount usb pens when plugged in
    for id in $(ls -1 /dev/disk/by-id 2> /dev/null); do
        if [ "$id" != "${id##usb-}" ]; then
            dev="$(ls -l /dev/disk/by-id/$id)"
            dev=${dev##*/}
            if [ -z "$(wmiir ls /rbar | grep 60usb-$dev)" ]; then
                udi=$(hal-find-by-property --key block.device --string /dev/$dev)
                if [ "$(hal-get-property --udi $udi --key volume.is_mounted)" = "false" ]; then
                    thunar-volman -a $udi
                fi
                if [ "$(hal-get-property --udi $udi --key volume.is_mounted)" = "true" ]; then
                    echo -n "$WMII_FOCUSCOLORS $dev" | wmiir create /rbar/60usb-$dev
                fi
            fi
        fi
    done
    # focus/unfocus/remove the buttons when the usb pens are
    # mounted/unmounted/unplugged
    for i in $(wmiir ls /rbar); do
        dev="${i##60usb-}"
        udi=$(hal-find-by-property --key block.device --string /dev/$dev)                       
        if [ "$dev" != "$i" ]; then
            if [ ! -e /dev/$dev ]; then
                wmiir remove /rbar/60usb-$dev
            elif [ "$(hal-get-property --udi $udi --key volume.is_mounted)" = "true" ]; then
                echo -n "$WMII_FOCUSCOLORS $dev" | wmiir write /rbar/60usb-$dev
            else
                echo -n "$WMII_NORMCOLORS $dev" | wmiir write /rbar/60usb-$dev
            fi
        fi
    done
}

toggleUSB() {
    local udi=$(hal-find-by-property --key block.device --string "/dev/$1")
    if [ "$(hal-get-property --udi $udi --key volume.is_mounted)" = "false" ]; then
        thunar-volman -a $udi 
    else
        dbus-send --system --print-reply --dest=org.freedesktop.Hal $udi org.freedesktop.Hal.Device.Volume.Unmount array:string:
    fi
}

### Events

local_events() {
    cat <<'!'

# Bar clicks
Event RightBarClick
    shift
    case "$@" in
    60*)
        toggleUSB ${@##60usb-} ;;
    esac

# Actions
Action status
    set +xv
    if removeStatusBars 2>/dev/null; then
        true
    fi
    createStatusBars
    while updateStatusBars; do
            sleep 1
    done
!
}

Hope this helps,
LuX.

Last edited by LuX (2010-07-21 10:35:23)

Offline

#380 2010-07-31 22:07:21

lagagnon
Member
From: an Island in the Pacific...
Registered: 2009-12-10
Posts: 1,087
Website

Re: The wmii thread

Am using the latest version of wmii (3.9.2-1) and I note a difference to the old version (3.6). By default the new version puts multiple clients in one column into "stack" mode, rather than "default" mode. I have checked the wmiirc file and cannot seem to find any statement that is forcing this behaviour. Has anyone else noted this and if so is there a way to force it to actually be in column "default" mode?


Philosophy is looking for a black cat in a dark room. Metaphysics is looking for a black cat in a dark room that isn't there. Religion is looking for a black cat in a dark room that isn't there and shouting "I found it!". Science is looking for a black cat in a dark room with a flashlight.

Offline

#381 2010-08-01 08:47:38

dengu
Member
Registered: 2010-06-01
Posts: 31

Re: The wmii thread

@lagagnon: See post #380, right on this page...

Offline

#382 2010-08-01 15:54:26

lagagnon
Member
From: an Island in the Pacific...
Registered: 2009-12-10
Posts: 1,087
Website

Re: The wmii thread

DOH! Hit me over the head with a mallet perhaps I should learn to read! Thanks LuX and dengu!


Philosophy is looking for a black cat in a dark room. Metaphysics is looking for a black cat in a dark room that isn't there. Religion is looking for a black cat in a dark room that isn't there and shouting "I found it!". Science is looking for a black cat in a dark room with a flashlight.

Offline

#383 2010-08-07 21:21:39

LuX
Member
From: France
Registered: 2010-06-14
Posts: 49

Re: The wmii thread

Hello list!

Although wimenu provides a simple and efficient way to access every programs using $Mod1-p as default key binding, it happens that I can't remember the name of a program and would prefer a more classical menu such as those based on xdg, provided by most desktop managers.

What I'm looking for is the following feature: some key binding (say $Mod1-Shift-p) displays with wimenu the list all available non empty categories (among "Accessories", "Game", "Multimedia", "Office", "System", and so on), and the selection of one of these categories then displays (via wimenu again) the list of all available programs in this category.

I can figure out how to write a script which would implement this feature by combining xdg_menu and wimenu, but I don't want to re-invent the wheel: did anybody in this list already write such a script?

Regards,
LuX.

Offline

#384 2010-08-07 22:30:41

lagagnon
Member
From: an Island in the Pacific...
Registered: 2009-12-10
Posts: 1,087
Website

Re: The wmii thread

LuX: not exactly similar but there are some ideas on this dmenu thread:  https://bbs.archlinux.org/viewtopic.php?id=80145


Philosophy is looking for a black cat in a dark room. Metaphysics is looking for a black cat in a dark room that isn't there. Religion is looking for a black cat in a dark room that isn't there and shouting "I found it!". Science is looking for a black cat in a dark room with a flashlight.

Offline

#385 2010-08-08 23:18:42

LuX
Member
From: France
Registered: 2010-06-14
Posts: 49

Re: The wmii thread

lagagnon wrote:

LuX: not exactly similar but there are some ideas on this dmenu thread:  https://bbs.archlinux.org/viewtopic.php?id=80145

Very nice link, thank you, lagagnon!

Following it I discovered that recent versions of dmenu have a vertical mode. This is more convenient for what I'm looking for, than the horizontal mode of wimenu (my very little screen can display only a few menu entries on a line). Thus I wrote a bash script which displays "ordinary" (that is: based on xdg) menus and submenus in wmii, using dmenu instead of wimenu, and I'm happy with it. smile

Last edited by LuX (2010-08-09 13:29:56)

Offline

#386 2010-09-03 20:17:58

Zerimas
Member
From: Waterloo, Ontario
Registered: 2009-08-25
Posts: 21

Re: The wmii thread

I seem to be having some issues with wmii.  For some reason wmii refuses to open Chromium in a managed  (non-floating) layer despite explicit tag rules.  How can I correct this behaviour.

Offline

#387 2010-09-04 20:06:45

lagagnon
Member
From: an Island in the Pacific...
Registered: 2009-12-10
Posts: 1,087
Website

Re: The wmii thread

Zerimas: no problems doing that here with wmii 3.9.2-1 and Chromium 5.0.375...
Perhaps show us what you have in your wmiirc file?


Philosophy is looking for a black cat in a dark room. Metaphysics is looking for a black cat in a dark room that isn't there. Religion is looking for a black cat in a dark room that isn't there and shouting "I found it!". Science is looking for a black cat in a dark room with a flashlight.

Offline

#388 2010-09-26 02:59:31

HashBox
Member
Registered: 2009-01-22
Posts: 271

Re: The wmii thread

Hi guys, I haven't posted on this forum in ages, but I just thought I'd share my wmiirc with you all, it is written in Chicken Scheme and is based on the example from the wmii egg. You can find it here http://github.com/ZaneA/Dotfiles/blob/master/wmiirc.scm. Pretty standard wmiirc feature wise, but I tried to clean up the example and seperate out the status stuff, so it's easy to add new status items now. Keybindings are pretty standard iirc. I also added the ability to evaluate scheme forms by pressing MOD+Shift+: and entering some scheme, and the returned value is place on the lbar. I plan to extend/create a small library of functions that could be useful in a desktop environment, and use them with this eval feature. So far I just have a small run macro that can be used like

(run "uptime" as "hash" on "server:22")

smile

Offline

#389 2010-10-03 20:10:22

CalcAndCoffee
Member
From: College Park, MD
Registered: 2009-02-23
Posts: 51
Website

Re: The wmii thread

@HashBox: that's pretty awesome; thanks!  I'm using it at the moment, since the Ruby wmiirc is a little broken.

Now, about the Ruby wmiirc: when using it with TwinView, it leaves space on the second monitor for the bar. I'm not sure exactly when it started, but it occurs in the current wmii (3.9.2-1) from the repos and didn't at some point before.

Anyone else have the same trouble (or, better yet, a fix)?


Arch x86_64 on a {ThinkPad T61p, Cr-48}; XFCE.
my code; silly things I've written.

Offline

#390 2010-10-17 03:24:43

lagagnon
Member
From: an Island in the Pacific...
Registered: 2009-12-10
Posts: 1,087
Website

Re: The wmii thread

My usual modus operandi with wmii is to have two terminals in the left column and the browser (Opera) in the right column - the right one being somewhat wider. When I boot I have all three apps launched from my .xinitrc and I specify the column width in my wmiirc file. By default all three apps launch on one clumn underneath each other - so I then have to send Opera to the right column. How can I launch Opera and have it automatically sent to the rightmost column?


Philosophy is looking for a black cat in a dark room. Metaphysics is looking for a black cat in a dark room that isn't there. Religion is looking for a black cat in a dark room that isn't there and shouting "I found it!". Science is looking for a black cat in a dark room with a flashlight.

Offline

#391 2010-10-23 14:50:21

hustletrees
Member
From: capital region, new york
Registered: 2010-06-14
Posts: 27

Re: The wmii thread

i'm having some issues with using the wmiirc_local file using wmii 3.9.2-2. no matter what i do to it or put in it, every time i try to start wmii there are no tags and nothing in the lbar or rbar. i even tried just copying /etc/wmii/wmiirc to ~/.wmii/wmiirc_local and not editing it at all and it still causes this behavior. wmii seems pretty nice from what i've been able to gather but not being able to use any local configuration is driving me nuts. any ideas?


while you home relaxed I'm squeezin Macs bustin off caps those coward cats with gold and platinum plaques get taxed and i do jooks and sling pies to make cream rise it's all about these green guys front and your whole team dies how i'm livin? so far swell you can't scar L head of the cartel sellin more cakes than Carvel

Offline

#392 2010-12-07 19:44:04

taree
Member
Registered: 2010-12-07
Posts: 2

Re: The wmii thread

also using 3.9.2-2, wmii freeze when started (fresh install, so i might have forgotten something), but is showing black background and white white bottom bar without info in it, it's not responding to any keys. i have used wmii before so i am familiar with how it is supposed to work.
Xorg.0.log shows no errors.
anyone else having these problems?
(sorry for bad english)

Offline

#393 2010-12-20 16:20:27

clynamen
Member
Registered: 2010-09-20
Posts: 11
Website

Re: The wmii thread

There's someway to start programs in a layout (e.g. two row ,  one split in two columns) at the startup?

Offline

#394 2011-01-09 19:27:29

zyxon
Member
From: Hungary
Registered: 2010-08-31
Posts: 36
Website

Re: The wmii thread

I'm having the same issue with wmii. It doesn't respond to any key shortcut Like M+Return.

Offline

#395 2011-01-29 16:39:59

aclindsa
Member
Registered: 2011-01-29
Posts: 24
Website

Re: The wmii thread

I'm having an issue where Chromium by default always starts in the floating layer. I can, of course, move it to the non-floating layer with Mod-Shift-Space. However, this is very annoying. Additionally, after I have made Chromium a non-floating window, if I then move it to another view via Mod-Shift-t, it becomes a floating window again. The following is the relevant section of ~/.wmii/wmii_local file:

# Tagging rules
wmiir write /tagrules <<!
/Chromium.*/ -> internet
/.*/ -> sel
!

Is there any particular reason that Chromium always gets placed on the floating layer by default? I haven't noticed this with any other applications.

Last edited by aclindsa (2011-01-29 16:44:15)

Offline

#396 2011-02-05 20:16:30

lagagnon
Member
From: an Island in the Pacific...
Registered: 2009-12-10
Posts: 1,087
Website

Re: The wmii thread

lagagnon wrote:

My usual modus operandi with wmii is to have two terminals in the left column and the browser (Opera) in the right column - the right one being somewhat wider. When I boot I have all three apps launched from my .xinitrc and I specify the column width in my wmiirc file. By default all three apps launch on one clumn underneath each other - so I then have to send Opera to the right column. How can I launch Opera and have it automatically sent to the rightmost column?

I finally joined the suckless.org dev mailing list (which deals with both dwm, wmii and dmenu topics) and got this response to the question above, in case Arch users of wmii are interested:

Assuming your browser takes longer to start than your terminal, this should do:

 
wmiir read /event | grep -m 2 CreateClient && wmiir xwrite /client/sel
send right

Philosophy is looking for a black cat in a dark room. Metaphysics is looking for a black cat in a dark room that isn't there. Religion is looking for a black cat in a dark room that isn't there and shouting "I found it!". Science is looking for a black cat in a dark room with a flashlight.

Offline

#397 2011-04-12 14:17:32

Phasmantistes
Member
Registered: 2011-04-12
Posts: 4

Re: The wmii thread

Hey everybody, I'm having the same problem as Napsy did a few months ago:

napsy wrote:

When I choose my session and login, the buttom bar appears but the keyboard doesn't work. If I go with my mouse pointer to the left or right screen border, the resize cursor appears. There is no font on the screen just the buttom bar and the background.

I have wmii 3.9.2-2, but I usually use xmonad. Xmonad works just fine. Unfortunately, it looks like Napsy's problem was resolved by switching the login shell from zsh to bash -- mine is already bash.

Ideas? Suggestions?

Offline

#398 2011-05-08 19:35:08

sunaku
Member
From: /dev/tty
Registered: 2010-09-29
Posts: 140
Website

Re: The wmii thread

Still rocking wmii... since 2005! cool

  • tOGxyYw (clean)

  • tOGxyZQ (dirty)

wmii (ruby) + vim + dotfiles

Offline

#399 2011-05-08 19:40:11

sunaku
Member
From: /dev/tty
Registered: 2010-09-29
Posts: 140
Website

Re: The wmii thread

Phasmantistes wrote:

Hey everybody, I'm having the same problem as Napsy did a few months ago:

napsy wrote:

When I choose my session and login, the buttom bar appears but the keyboard doesn't work. If I go with my mouse pointer to the left or right screen border, the resize cursor appears. There is no font on the screen just the buttom bar and the background.

I have wmii 3.9.2-2, but I usually use xmonad. Xmonad works just fine. Unfortunately, it looks like Napsy's problem was resolved by switching the login shell from zsh to bash -- mine is already bash.

Ideas? Suggestions?

Try running `startx -- :1` from a Linux virtual terminal instead of going through a graphical login manager.

Offline

#400 2011-05-11 09:03:34

Phasmantistes
Member
Registered: 2011-04-12
Posts: 4

Re: The wmii thread

sunaku wrote:

Try running `startx -- :1` from a Linux virtual terminal instead of going through a graphical login manager.

Thanks for the tip, but it has exactly the same result. Here's the logfile:
http://pastebin.com/AUi1LE92

Offline

Board footer

Powered by FluxBB