HOWTO: JWM Basic Configuration

Share your own howto's etc. Not for support questions!

HOWTO: JWM Basic Configuration

Postby Lou » 2014-06-17 21:09

JWM Basic Configuration

This is a very light, extremely fast window manager, one of my favorites.
First thing i do is copy the global config file (.jwmrc) to my /home, to
do that i update the database as root, look for it, and copy it to my /home.

Code: Select all

$ locate .jwmrc

$ cp  /etc/jwm/system.jwmrc .jwmrc

So, from now on i can access this file as user.

Code: Select all
$ nano .jwmrc

We're faced with a long config file but the good news is that there is only one file :)
Note that the wm is very configurable and this is a subjective matter, what
is good for me, is not necessariy good for you; there is a choice and it's all
up to you.

In the first part i configure my apps to be launched full-sized, maximized,
i like it that way, easy for me to work. No dragging, no resizing, just
alt-tab to move from one to the other.

Code: Select all


And so on, i do the same for xfe, iceweasel, sylpheed, xchat, etc. Make
sure lines are alienated in the correctly IF you want your apps maximized,
otherwise, ignore this section.

Next, i want the the tray/tool bar (is that the name?), on top and in autohide
to save real estate, if you like the default look, never mind :)

Code: Select all
 <Tray x="0" y="+1" height="20" autohide="true">

By default it comes with several workspaces, one on top of each other,
i only use 2, one next to the other:

Code: Select all

    <!-- Virtual Desktops -->
   <!-- Desktop tags can be contained within Desktops for desktop names. -->
   <Desktops width="2" height="1">



Code: Select all



Code: Select all
   <!-- Key bindings -->
   <Key key="Up">up</Key>
   <Key key="Down">down</Key>
   <Key key="Right">right</Key>
   <Key key="Left">left</Key>
   <Key key="h">left</Key>
   <Key key="j">down</Key>
   <Key key="k">up</Key>
   <Key key="l">right</Key>
   <Key key="Return">select</Key>
   <Key key="Escape">escape</Key>

   <Key mask="A" key="Tab">next</Key>
   <Key mask="" key="F4">close</Key>
   <Key mask="" key="F12">maximize</Key>
   <Key mask="4" key="Right">rdesktop</Key>
   <Key mask="4" key="Left">ldesktop</Key>

   <Key mask="" key="F1">exec:xterm</Key>
   <Key mask="" key="F2">exec:gmrun</Key>
   <Key mask="4" key="f">exec:iceweasel</Key>
   <Key mask="" key="F2">exec:xfe</Key>
   <Key mask="4" key="m">exec:sylpheed</Key>
   <Key mask="" key="F5">exec:sudo /sbin/halt -p</Key>
   <Key mask="" key="F6">exec:sudo /sbin/reboot</Key>
   <Key mask="4" key="u">exec:xchat</Key>
   <Key mask="4" key="g">exec:medit</Key>
   <Key mask="4" key="l">exec:libreoffice</Key>
   <Key mask="4" key="r">exec:jwm -restart</Key>
   <Key mask="" key="Print">exec:xterm -e scrot -cd 10</Key>
   <Key mask="4" key="F1">root:1</Key>
   <Key mask="" key="F8">exec:gmrun</Key>

  <Key mask="4" key="Down">>exec:amixer set Master 6%- </Key>
  <Key mask="4" key="Up">exec:amixer set Master 6%+ </Key>
  <Key mask="4" key="0">exec:amixer set Master 0</Key>



A = Alt
4 = Windows key

Alt-tab for moving btwn screens
Winkey + arrow right/left for changing workspaces
F4 closes apps
F12 maximizes screen
winkey + f launches browser
winkey + m launches sylpheed
Print key takes a picture with scrot
F1 launches terminal
F2 launches file manager
F4 closes app
F5 shutdown machine
F6 reboots
F8 launches run box
And so forth...

On F5 and F6 to shutdown/reboot the machine you have to have ALL type of
permission. To have that, edit /etc/sudoers as ROOT, and at the bottom add this:

Code: Select all
 macondo ALL = NOPASSWD : ALL

Replacing 'macondo' with your user name

To start jwm automatically as you enter X, edit the file .xinitrc as user:

Code: Select all
 $ nano .xinitrc

Here's mine:

Code: Select all

iceweasel &
setxkbmap -option terminate:ctrl_alt_bksp
xsetroot -solid black
xrdb -merge .Xdefaults
unclutter -idle 2 &
numlockx &
exec jwm

Devuan Jessie - IceWM - vimperator - no DM
KISS - Keep It Simple, Stupid
Posts: 1775
Joined: 2006-05-08 02:15

Re: HOWTO: JWM Basic Configuration

Postby ruffwoof » 2017-07-07 00:43

Bumping a old thread ... Joe's documentation is good for jwm and he keeps jwm updated. I've installed the jessie-backports version into jessie 8.8. i.e. added
Code: Select all
deb jessie-backports main

to /etc/apt/sources.list and then ran
Code: Select all
apt-get -t stretch-backports install jwm

(I deleted the backport repository from sources.list after jwm was installed)

Needed some changing around of things in .jwmrc to account for new formats/parameters ... which inspection of ~/.xsession-errors highlighted (I just worked my way through each one by one). My newer .jwmrc needs tidying up :
Code: Select all
<?xml version="1.0"?>


<!-- **********  ROOT MENU **********  -->

   <!-- The root menu, if this is undefined you will not get a menu. -->
   <!-- Additional RootMenu attributes: onroot, labeled, label -->

   <RootMenu height="15" onroot="12">
      <!-- <Program icon="terminal.png" label="Terminal">x-terminal-emulator</Program> -->
      <!-- <Program icon="lxterminal.xpm" label="Terminal">x-terminal-emulator</Program> -->

      <!-- #DEBIAN (left as a example)
         <Program icon="firefox.png" label="Www Browser">gnome-www-browser</Program>
         <Menu icon="folder.png" label="Applications">
            <Program icon="editor.png" label="Dia">dia</Program>
            <Program icon="video.png" label="Xine">gxine</Program>
         <Menu icon="folder.png" label="Utilities">
            <Program icon="calculator.png" label="Calculator">xcalc</Program>

      <!-- Debian Menu -->
      <!-- <Separator/>

      <Program label="Reboot" icon="reboot.png">sudo systemctl reboot</Program>
      <Program label="Power Off" icon="poweroff.png">sudo systemctl poweroff</Program>

      <Restart label="Reload jwm" icon="restart.png"/>
      <Exit label="Exit" confirm="true" icon="exit.png"/>


<!-- **********  GROUPS **********  -->

        Program groups allow one to specify options which apply
        to a group of programs by their name and/or class
        See :


      <Option>vmax</Option> --> <!-- maximises vertically --> <!--



<!-- ********** TRAY **********  -->

   <!-- Additional tray attributes: autohide, width, border, layer, layout -->
   <!-- <Tray  autohide="off" insert="right" x="0" y="-1" border="1" height="28" > -->
<!--   <Tray  x="0" y="-1" height="28" autohide="false"> -->
<Tray  x="0" y="-1" height="28">

      <!-- Additional TrayButton attribute: label -->
      <TrayButton label=" JWM ">root:1</TrayButton>
      <TrayButton label="__">showdesktop</TrayButton>

      <TrayButton popup="Terminal" icon="lxterminal.xpm" border="true">exec:lxterminal</TrayButton>
      <TrayButton popup="Files " icon="files.png" border="true">exec:pcmanfm</TrayButton>
      <TrayButton popup="Sound " icon="sound.png" border="true">exec:pavucontrol -t 3</TrayButton>
      <!-- pavucontrol tab 3 (output) -->

      <!-- Additional Pager attribute: labeled -->
      <Pager labeled="false"/>

      <TaskList maxwidth="2560"/>


      <!-- Additional Swallow attribute: height -->
      <Swallow name="xload" width="32">xload -nolabel -bg black -fg red -hl white</Swallow>

      <Clock format="%a %d %b %Y %H:%M"></Clock>


<!-- ********** Visual Styles **********  -->

      <!-- <Font>-*-fixed-*-r-*-*-10-*-*-*-*-*-*-*</Font> -->
      <Font>DeJaVu Sans -9</Font>

         <!-- <Title>#70849d:#2e3a67</Title> -->
         <!-- <Title>gray30:gray60</Title> -->

<!--      <Inactive>

      <!-- <Font>-*-fixed-*-r-*-*-10-*-*-*-*-*-*-*</Font> -->
      <Font>DeJaVu Sans -9</Font>
<!--      <ActiveForeground>black</ActiveForeground>

   <!-- Additional TrayStyle attribute: insert -->
      <!-- <Font>-*-fixed-*-r-*-*-10-*-*-*-*-*-*-*</Font> -->
      <!-- <Font>DeJaVu Sans -9:bold</Font> -->
      <Font>DeJaVu Sans -9</Font>

<!--      <ActiveForeground>#70849d</ActiveForeground>

      <!-- <Font>-*-fixed-*-r-*-*-10-*-*-*-*-*-*-*</Font> -->
      <Font>DeJaVu Sans -10</Font>
<!--       <ActiveForeground>white</ActiveForeground>

      <!-- <Font>-*-fixed-*-r-*-*-10-*-*-*-*-*-*-*</Font> -->
      <Font>DeJaVu Sans -10</Font>

<!-- ********** ICON PATHS **********  -->

   <!-- you can specify multiple IconPath's for each location where icons are stored -->

<!-- ********** TWEAKS **********  -->

   <!-- Virtual Desktops -->
   <!-- Desktop tags can be contained within Desktops for desktop names. -->
   <Desktops width="2" height="1">
           Default background. Note that a Background tag can be
           contained within a Desktop tag to give a specific background
           for that desktop.
      <Background type="image">/home/user/jwm-background.png</Background>

   <!-- *** MOUSE *** -->

   <!-- Double click speed (in milliseconds) -->

   <!-- Double click delta (in pixels) -->

   <!-- *** WINDOWS *** -->

   <!-- The focus model (sloppy or click) -->

   <!-- The snap mode (none, screen, or border) -->
   <SnapMode distance="10">border</SnapMode>

   <!-- The move mode (outline or opaque) -->
   <MoveMode coordinates="off">opaque</MoveMode>

   <!-- The resize mode (outline or opaque) -->
   <ResizeMode coordinates="off">opaque</ResizeMode>

<!-- ********** STARTUP ********** -->

        <StartupCommand>for i in $HOME/.config/autostart/*.desktop;do if [ -f $i ];then $i;fi;done</StartupCommand>
        Due to a bug xdg-open and exo-open open the desktop as a text file, still not fixed as of 2017

<!-- ********** Key bindings ********** -->

   <Key key="Up">up</Key>
   <Key key="Down">down</Key>
   <Key key="Right">right</Key>
   <Key key="Left">left</Key>
   <Key key="h">left</Key>
   <Key key="j">down</Key>
   <Key key="k">up</Key>
   <Key key="l">right</Key>
   <Key key="Return">select</Key>
   <Key key="Escape">escape</Key>

   <Key key="Menu">root:1</Key>
   <Key keycode="107">exec:/usr/bin/mtpaint -s</Key>  <!-- PrtScrn launches mtpaint screen capture -->

   <Key mask="A" key="Tab">next</Key>
   <Key mask="A" key="F4">close</Key>
   <Key mask="A" key="#">desktop#</Key>
   <Key mask="A" key="F1">root:1</Key>
   <Key mask="A" key="F2">exec:gmrun</Key>
   <Key mask="A" key="F10">maximize</Key>
   <Key mask="A" key="Right">rdesktop</Key>
   <Key mask="A" key="Left">ldesktop</Key>
   <Key mask="A" key="Up">udesktop</Key>
   <Key mask="A" key="Down">ddesktop</Key>


I've dumped using debian menu and fundamentally I've using just a setup of xorg, jwm and pcmanfm, where pcmanfm is also providing the desktop (i.e. launched with pcmanfm --desktop).

Really light. With firefox, libreoffice and a bunch of other things it takes up around 500MB in a squashed filesystem (liveboot) or 1.6GB uncompressed on disk. And as you say - all in one file (great for configuring exactly how you want things, but the downside of having to 'code' things rather than having different gui's to aid in configuration).

As part of mine I use the <StartupCommand> setting to run a script called startup in my home folder - that currently contains
Code: Select all
setxkbmap -option terminate:ctrl_alt_bksp
pcmanfm --desktop &
numlockx &
osmo &
xrandr --output DVI-I-2 --mode 1280x720_60.00 --output DVI-I-1 --off
radiotray &
libreoffice --quickstart &

My actual (jwm) menu (bottom (or top) left button more usually) is spartan, just basically exit. I'm using a combination of pcmanfm application folder bookmark (/usr/share/applications) and desktop icons as the main ways to select programs. Along with alt-F2 set to present gmrun (type in a program name to run).

Surprising that jwm is not a more popular choice IMO. On a USB stick in read only boot mode its really quick to boot and run, little different to if on HDD (i.e. live boot, with empty filesystem.squashfs and the main / folder set as the persistence folder ... booted using persitence persistence-read-only kernel boot parameters). Booted that way and all writes are to ram and generally as USB sticks read relatively quickly but write relatively slowly that really makes a significant difference. With a reasonably complete desktop of browser, office, pulseaudio ...etc, 1.6GB uncompressed 500MB compressed is pretty decent compared to the standard Debian LiveCD's (Xfce, LXDE ...etc). That is cheating some however as I've installed localepurge and zero sized man and doc files (so for instance man live-boot brings up a empty page (I have little need for local documentation when its readily available online anyway)). I also purged non essentials and set apt to not install recommended or suggested i.e. /etc/apt/apt.conf content of
Code: Select all
APT::Install-Recommends "0" ; APT::Install-Suggests "0" ;

My setup has a old 720p 32" TV as the display as that's easier on my tired eyes. So I tweak it to use the 1280x720 resolution (nvidia card, but no nvidia driver i.e. everything is just MAIN repository stuff only (and only jwm being backported). i.e. /etc/apt/sources.list contains just ...
Code: Select all
deb jessie main
deb jessie/updates main

What ... no GTK2 or GTK3 !! :)
Debian OldStable (Jessie MAIN only), Xfce (pcmanfm desktop) + brightside hot corners (top left set to toggle show/hide desktop)
Acer Aspire M3201 (2GB), AMD Phenom X4, Nvidia GT8600
Posts: 132
Joined: 2016-08-20 21:00

Return to Docs, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 2 guests