Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

HOWTO: JWM Basic Configuration

Share your HowTo, Documentation, Tips and Tricks. Not for support questions!.
Post Reply
Message
Author
Lou
Posts: 1739
Joined: 2006-05-08 02:15

HOWTO: JWM Basic Configuration

#1 Post by Lou »

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

#updatedb

$ 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.

APPS OPTIONS

Code: Select all


 <Group>
   <Name>xterm</Name>
   <Option>maximized</Option>
 </Group>
 

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.

TOOLBAR
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">
 


WORKSPACES
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">

 

TITLEBAR ELIMINATION

Code: Select all

  <WindowStyle>

      <Font>-*-fixed-*-r-*-*-10-*-*-*-*-*-*-*</Font>
      <Width>1</Width>
      <Height>2</Height>
      
  

KEYBINDINGS

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>

#Volume
  <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>

</JWM>
  

  

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

 #!/bin/sh

iceweasel &
setxkbmap -option terminate:ctrl_alt_bksp
xsetroot -solid black
xrdb -merge .Xdefaults
unclutter -idle 2 &
numlockx &
exec jwm
save/exit/reboot
Devuan Jessie - IceWM - vimperator - no DM
KISS - Keep It Simple, Stupid

ruffwoof
Posts: 298
Joined: 2016-08-20 21:00

Re: HOWTO: JWM Basic Configuration

#2 Post by ruffwoof »

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 http://ftp.debian.org/debian 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"?>

<JWM>

<!-- **********  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>
         <Menu icon="folder.png" label="Utilities">
            <Program icon="calculator.png" label="Calculator">xcalc</Program>
         </Menu>
      -->

      <!-- Debian Menu -->
<!--
      <Include>/etc/jwm/debian-menu</Include>
-->
      <!-- <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"/>

   </RootMenu>


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

   <!--
        Program groups allow one to specify options which apply
        to a group of programs by their name and/or class
        See : https://joewing.net/projects/jwm/config.shtml#groups
   -->

   <Group>
      <Class>Pidgin</Class>
      <Option>sticky</Option>
   </Group>
<!--
   <Group>
      <Name>gkrellm</Name>
      <Option>nolist</Option>
      <Option>sticky</Option>
   </Group>

   <Group>
      <Name>xterm</Name>
      <Option>vmax</Option> --> <!-- maximises vertically --> <!--
      <Option>icon:terminal.png</Option>
   </Group>
-->

   <Group>
     <Name>lxterminal</Name>
     <Option>maximized</Option>
   </Group>

   <Group>
     <Name>firefox-esr</Name>
     <Option>maximized</Option>
   </Group>


<!-- ********** 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"/>

      <Dock/>

      <!-- 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>

   </Tray>

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

   <WindowStyle>
      <!-- <Font>-*-fixed-*-r-*-*-10-*-*-*-*-*-*-*</Font> -->
      <Font>DeJaVu Sans -9</Font>
      <Width>4</Width>
      <Height>20</Height>

      <Active>
         <Foreground>white</Foreground>
         <!-- <Title>#70849d:#2e3a67</Title> -->
         <!-- <Title>gray30:gray60</Title> -->
         <Outline>black</Outline>
         <Opacity>1.0</Opacity>
      </Active>

<!--      <Inactive>
         <Foreground>#aaaaaa</Foreground>
         <Title>#808488:#303438</Title>
         <Outline>black</Outline>
         <Opacity>0.5:0.9:0.1</Opacity>
      </Inactive>
-->
   </WindowStyle>

   <TaskListStyle>
      <!-- <Font>-*-fixed-*-r-*-*-10-*-*-*-*-*-*-*</Font> -->
      <Font>DeJaVu Sans -9</Font>
<!--      <ActiveForeground>black</ActiveForeground>
      <ActiveBackground>gray80:gray90</ActiveBackground>
-->
      <Foreground>black</Foreground>
      <Background>gray90:gray50</Background>
   </TaskListStyle>

   <!-- Additional TrayStyle attribute: insert -->
   <TrayStyle>
      <!-- <Font>-*-fixed-*-r-*-*-10-*-*-*-*-*-*-*</Font> -->
      <!-- <Font>DeJaVu Sans -9:bold</Font> -->
      <Font>DeJaVu Sans -9</Font>
      <Background>gray90</Background>
      <Foreground>black</Foreground>
      <Opacity>0.75</Opacity>
   </TrayStyle>

   <PagerStyle>
      <Outline>black</Outline>
      <Foreground>gray90</Foreground>
      <Background>#808488</Background>
<!--      <ActiveForeground>#70849d</ActiveForeground>
      <ActiveBackground>#2e3a67</ActiveBackground>
-->
   </PagerStyle>

   <MenuStyle>
      <!-- <Font>-*-fixed-*-r-*-*-10-*-*-*-*-*-*-*</Font> -->
      <Font>DeJaVu Sans -10</Font>
      <Foreground>black</Foreground>
      <Background>white</Background>
<!--       <ActiveForeground>white</ActiveForeground>
      <ActiveBackground>#98B9FF:#98B9E2</ActiveBackground>
-->
      <Opacity>0.85</Opacity>
   </MenuStyle>

   <PopupStyle>
      <!-- <Font>-*-fixed-*-r-*-*-10-*-*-*-*-*-*-*</Font> -->
      <Font>DeJaVu Sans -10</Font>
      <Outline>black</Outline>
      <Foreground>black</Foreground>
      <Background>#F5F5B5</Background>
   </PopupStyle>


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

   <!-- you can specify multiple IconPath's for each location where icons are stored -->
   <IconPath>/usr/share/pixmaps</IconPath>
   <IconPath>/home/user/.icons/ROX/MIME</IconPath>
   <IconPath>/usr/share/icons/Adwaita/48x48/apps</IconPath>


<!-- ********** 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>
   </Desktops>


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

   <!-- Double click speed (in milliseconds) -->
   <DoubleClickSpeed>400</DoubleClickSpeed>

   <!-- Double click delta (in pixels) -->
   <DoubleClickDelta>2</DoubleClickDelta>


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

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

   <!-- 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>/home/user/startup</StartupCommand>
   <!--
        <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>

</JWM>
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

#!/bin/bash
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 http://deb.debian.org/debian/ jessie main
deb http://security.debian.org/ jessie/updates main
Image
What ... no GTK2 or GTK3 !! :)

debianfan4
Posts: 1
Joined: 2017-07-25 06:35

Re: HOWTO: JWM Basic Configuration

#3 Post by debianfan4 »

ruffwoof wrote: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 http://ftp.debian.org/debian 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"?>

<JWM>

<!-- **********  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>
         <Menu icon="folder.png" label="Utilities">
            <Program icon="calculator.png" label="Calculator">xcalc</Program>
         </Menu>
      -->

      <!-- Debian Menu -->
<!--
      <Include>/etc/jwm/debian-menu</Include>
-->
      <!-- <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"/>

   </RootMenu>


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

   <!--
        Program groups allow one to specify options which apply
        to a group of programs by their name and/or class
        See : https://joewing.net/projects/jwm/config.shtml#groups
   -->

   <Group>
      <Class>Pidgin</Class>
      <Option>sticky</Option>
   </Group>
<!--
   <Group>
      <Name>gkrellm</Name>
      <Option>nolist</Option>
      <Option>sticky</Option>
   </Group>

   <Group>
      <Name>xterm</Name>
      <Option>vmax</Option> --> <!-- maximises vertically --> <!--
      <Option>icon:terminal.png</Option>
   </Group>
-->

   <Group>
     <Name>lxterminal</Name>
     <Option>maximized</Option>
   </Group>

   <Group>
     <Name>firefox-esr</Name>
     <Option>maximized</Option>
   </Group>


<!-- ********** 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"/>

      <Dock/>

      <!-- 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>

   </Tray>

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

   <WindowStyle>
      <!-- <Font>-*-fixed-*-r-*-*-10-*-*-*-*-*-*-*</Font> -->
      <Font>DeJaVu Sans -9</Font>
      <Width>4</Width>
      <Height>20</Height>

      <Active>
         <Foreground>white</Foreground>
         <!-- <Title>#70849d:#2e3a67</Title> -->
         <!-- <Title>gray30:gray60</Title> -->
         <Outline>black</Outline>
         <Opacity>1.0</Opacity>
      </Active>

<!--      <Inactive>
         <Foreground>#aaaaaa</Foreground>
         <Title>#808488:#303438</Title>
         <Outline>black</Outline>
         <Opacity>0.5:0.9:0.1</Opacity>
      </Inactive>
-->
   </WindowStyle>

   <TaskListStyle>
      <!-- <Font>-*-fixed-*-r-*-*-10-*-*-*-*-*-*-*</Font> -->
      <Font>DeJaVu Sans -9</Font>
<!--      <ActiveForeground>black</ActiveForeground>
      <ActiveBackground>gray80:gray90</ActiveBackground>
-->
      <Foreground>black</Foreground>
      <Background>gray90:gray50</Background>
   </TaskListStyle>

   <!-- Additional TrayStyle attribute: insert -->
   <TrayStyle>
      <!-- <Font>-*-fixed-*-r-*-*-10-*-*-*-*-*-*-*</Font> -->
      <!-- <Font>DeJaVu Sans -9:bold</Font> -->
      <Font>DeJaVu Sans -9</Font>
      <Background>gray90</Background>
      <Foreground>black</Foreground>
      <Opacity>0.75</Opacity>
   </TrayStyle>

   <PagerStyle>
      <Outline>black</Outline>
      <Foreground>gray90</Foreground>
      <Background>#808488</Background>
<!--      <ActiveForeground>#70849d</ActiveForeground>
      <ActiveBackground>#2e3a67</ActiveBackground>
-->
   </PagerStyle>

   <MenuStyle>
      <!-- <Font>-*-fixed-*-r-*-*-10-*-*-*-*-*-*-*</Font> -->
      <Font>DeJaVu Sans -10</Font>
      <Foreground>black</Foreground>
      <Background>white</Background>
<!--       <ActiveForeground>white</ActiveForeground>
      <ActiveBackground>#98B9FF:#98B9E2</ActiveBackground>
-->
      <Opacity>0.85</Opacity>
   </MenuStyle>

   <PopupStyle>
      <!-- <Font>-*-fixed-*-r-*-*-10-*-*-*-*-*-*-*</Font> -->
      <Font>DeJaVu Sans -10</Font>
      <Outline>black</Outline>
      <Foreground>black</Foreground>
      <Background>#F5F5B5</Background>
   </PopupStyle>


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

   <!-- you can specify multiple IconPath's for each location where icons are stored -->
   <IconPath>/usr/share/pixmaps</IconPath>
   <IconPath>/home/user/.icons/ROX/MIME</IconPath>
   <IconPath>/usr/share/icons/Adwaita/48x48/apps</IconPath>


<!-- ********** 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>
   </Desktops>


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

   <!-- Double click speed (in milliseconds) -->
   <DoubleClickSpeed>400</DoubleClickSpeed>

   <!-- Double click delta (in pixels) -->
   <DoubleClickDelta>2</DoubleClickDelta>


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

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

   <!-- 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>/home/user/startup</StartupCommand>
   <!--
        <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>

</JWM>
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

#!/bin/bash
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 http://deb.debian.org/debian/ jessie main
deb http://security.debian.org/ jessie/updates main
Image
What ... no GTK2 or GTK3 !! :)
I agree Joe's documentation is good for jwm. The best part is he keeps it updated at a timely manner

ruffwoof
Posts: 298
Joined: 2016-08-20 21:00

Re: HOWTO: JWM Basic Configuration

#4 Post by ruffwoof »

Joe's helpful too. A email I posted was answered the same day.

I've added brightside (apt-get install brightside) that caters for hot corners; And I've set the top left to invoke Toggle Show/Hide Desktop (in a terminal run brightside-properties). So now when a full screen window is active, move the mouse into the top left screen edge and the desktop is revealed, where you can have all your favourite icons at the ready to be launched. Somewhat gnome3'ish, but where you get to choose which and what icons are shown when 'activated'.

Conceptually you could set up different wallpapers and icons on different desktops such that you could scroll through those (switch desktops), perhaps arranged by groupings (maybe something like : multi-media icons on desktop 4, office on desktop 3, internet on desktop 2, general on desktop 1).

I've opted to drop having a startup script being called from within .jwmrc to simply putting all of the startup commands in .jwmrc itself. You can have multiple <StartupCommand>....</StartupCommand> entries, for instance this is just one of mine

<StartupCommand>mpv --fs /home/user/startup.dvd</StartupCommand>

that loads a startup splash clip that I use instead of just a simple sound. Or you can run multiple things, throwing each into the background

Code: Select all

<StartupCommand>
Esetroot -m $HOME/.wallpaper
xscreensaver &
tilda  &

# do not forget ampersand after each
</StartupCommand>
Keeps things simpler. No gtk theme (use the internal default raleigh but perhaps with some tweaks i.e. create a ~/.gtkrc-2.0 and edit that as desired, a single configuration file (.jwmrc) that includes all window decorations and startup commands, pcmanfm serving as both the file manager and desktop icons manager.

jwm is lightweight ... and operationally is really quick to use. With video editing and a plethora of other things installed (office, firefox, blender, inkscape etc.) as a squashed filesystem mine currently weighs in at 660MB (around 2.2GB extracted on disk), a fully functional setup that is less than half the size of other desktop choices (Debian LiveCD's) ... and not that much bigger than a standard cli only livecd.

As a secondary boot I also run FreeBSD. I've set that up to use brightside as well and intent to move that over from a Mate desktop to jwm.

Image

ruffwoof
Posts: 298
Joined: 2016-08-20 21:00

Re: HOWTO: JWM Basic Configuration

#5 Post by ruffwoof »

Have dropped using pcmanfm (apt-get purge pcmanfm;apt-get autoremove) and replaced both the file manager and desktop icon management using rox-filer (apt-get install rox-filer)

relevant startup commands within ~/.jwmrc now looks like

<StartupCommand>rox -p /home/user/rox/Pin1</StartupCommand>

Created a ~/rox folder and within that I created a Pin1, and copied that to Pin2 and Pin3 (3 desktops are enough for me)

Also changed the desktops section within ~/.jwmrc

<!-- Number of virtual desktops -->
<Desktops width="3" height="1">
<Desktop><Background type="command">rox -p /home/user/rox/Pin1</Background></Desktop>
<Desktop><Background type="command">rox -p /home/user/rox/Pin2</Background></Desktop>
<Desktop><Background type="command">rox -p /home/user/rox/Pin3</Background></Desktop>
</Desktops>

.... and now have three desktops and I've set the background (wallpaper) and icons different on each. I have the first containing common choices such as file manager, calculator ... etc. The second is pretty much empty except for a firefox icon. The third is pretty busy with multi-media type icons.

Image

Image

Image

EDIT/Update

I've also created 3 .desktop files that look something like

[Desktop Entry]
Keywords=Desktop1
Name=dektop1
Comment=Switch to desktop 1
Exec=rox -p /home/user/rox/Pin1
Icon=dot
Terminal=false
Type=Application

... but one for each desktop, so I can include desktop icons on each desktop (that I've dropped in towards the right screen edge) that switch to the other desktops

Image
2.2GB disk space with all the apps/programs I have installed, that compresses down to around 560MB compressed squashfs file (using mksquashsf /mnt/sda1 /live/filesystem.squashfs -comp xz -Xbcj x86 -b 524288 compression parameters) that I can live-boot ... and boy is that quick - even on this 10 year old PC :)

Another tweak I've made is to set the right WIN (special) key to launch gmrun dialog by adding
<Key key="Super_R">exec:gmrun</Key>
to ~/.jwmrc. With bash's auto-complete and history that's quite neat i.e. Right WIN key and type lea and then TAB autocompletes leafpad (text editor); Or right WIN and use the up/down arrow keys to step back through commands run historically.

Post Reply