June 5, 2019

Starting our collection of windows on linux

On the suns, when the pilot logs in, a bunch of windows automatically get launched. We would like to do the same on linux.

On the suns (Solaris 8), this is done in the file ".openwin-init", the last few lines of which look like:

toolwait /usr/openwin/bin/clock -Wp 0 285 -Ws 120 70 -WP 0 284 -Wi +Wn -12 -analog +date +seconds -alarmtime 0:0
toolwait /usr/openwin/bin/filemgr -Wp 624 385 -Ws 574 546 -WP 10 914 -Wi
toolwait /usr/openwin/bin/perfmeter -Wp 0 144 -Ws 64 128 -WP 0 144 +Wi -t cpu -t disk -M cpu 100 100 100 -M disk 40 40 2147483647 -g -L -V -Wn -s 2 -h 20 -m 2
toolwait mailtool -Wp 75 0 -Ws 585 326 -WP 0 360  -Wi
toolwait xgterm -name ovenRed -title 'Red IRAF XGterm (orig)' -e cl
toolwait xgterm -name ovenGreen -title 'Green IRAF XGterm (orig)' -e cl
toolwait xgterm -name ovenPurple -title 'Purple IRAF XGterm (orig)' -e cl
toolwait xgterm -name ovenBlue -title 'Blue IRAF XGterm (orig)' -e cl
The colors and such of each windows is specified in the .Xdefaults (or .Xresources) file.

On linux under XFCE

Who knows how this might work under linux/Gnome.

Multiple workspaces

It is possible to start a given application in a specified workspace. Two tools allow this to be done: "wmctrl" or "devilspie". Here is how each could be used to launch "mc" (midnight commander) in workspace 2
dnf install wmctrl

#!/bin/sh
window="mc"
xfce4-terminal --title "$window" -x mc
wmctrl -r "$window" -t 2
wmctrl -r "$window" -b toggle,fullscreen
As for devilspie, there are two fedora packages: devilspie and devilspie2.
dnf install devilspie

if
    (is (window_name) "mc")
    (begin
       (set_workspace 2)
    )
)

Have any comments? Questions? Drop me a line!

Tom's home page / tom@mmto.org