<?xml version="1.0"?>
<JWM>

    <!-- Root menu: regenerated from .desktop files on every -restart/-reload.
         onroot="0" + the root Mouse bindings below = no desktop-click menus. -->
    <RootMenu onroot="0">
        <Include>exec:python3 /home/epochryphon/.jwm/gen-menu.py</Include>
        <Separator/>
        <Program icon="utilities-terminal" label="Terminal">xterm</Program>
        <Program icon="lock" label="Lock">xscreensaver-command -lock</Program>
        <Separator/>
        <Restart label="Restart" icon="reload"/>
        <Program label="Power Off">/usr/libexec/jwm/jwm-poweroff.sh</Program>
        <Exit label="Log Out" confirm="true" icon="exit"/>
    </RootMenu>

    <!-- Groups. A group with no Class/Name applies to ALL windows. -->
    <Group>
        <Class>Synapse</Class>
        <Option>border</Option>
        <Option>title</Option>
    </Group>
    <Group>
        <Option>aerosnap</Option>
    </Group>
    <Group>
        <Name>xterm</Name>
        <Option>vmax</Option>
    </Group>
    <Group>
        <Name>xclock</Name>
        <Option>drag</Option>
        <Option>notitle</Option>
    </Group>

    <!-- Bottom tray: start button, tasks, dock, clock. No pager, no show-desktop. -->
    <Tray height="40">
        <TrayButton icon="/usr/share/pixmaps/trisquel.png">root:0</TrayButton>
        <Spacer width="2"/>
        <TaskList maxwidth="256"/>
        <Dock/>
        <Clock format="%l:%M %p"><Button mask="123">exec:xclock</Button></Clock>
    </Tray>

    <!-- Styles -->
    <WindowStyle decorations="motif">
        <Font>Sans-12:bold</Font>
        <Width>4</Width>
        <Corner>0</Corner>
        <Foreground>#FFFFFF</Foreground>
        <Background>#555555</Background>
        <Opacity>0.5</Opacity>
        <Active>
            <Foreground>#222222</Foreground>
            <Background>#BBBBBB</Background>
        </Active>
    </WindowStyle>
    <TrayStyle decorations="motif">
        <Font>Sans-12</Font>
        <Background>#333333</Background>
        <Foreground>#FFFFFF</Foreground>
        <Opacity>0.75</Opacity>
    </TrayStyle>
    <TaskListStyle list="all" group="true">
        <Font>Sans-12</Font>
        <Foreground>#FFFFFF</Foreground>
        <Background>#333333</Background>
        <Active>
            <Foreground>#FFFFFF</Foreground>
            <Background>#555555</Background>
        </Active>
    </TaskListStyle>
    <MenuStyle decorations="motif">
        <Font>Sans-12</Font>
        <Foreground>#FFFFFF</Foreground>
        <Background>#333333</Background>
        <Active>
            <Foreground>#FFFFFF</Foreground>
            <Background>#0077CC</Background>
        </Active>
        <Opacity>0.85</Opacity>
    </MenuStyle>
    <PopupStyle>
        <Font>Sans-12</Font>
        <Foreground>#000000</Foreground>
        <Background>#999999</Background>
    </PopupStyle>

    <!-- Icons: 32px rasters first (no downscaling 512px art), then scalable,
         then catch-alls. Delete the 4 Flatpak lines if `flatpak list` is empty. -->
    <IconPath>/var/lib/flatpak/exports/share/icons/hicolor/128x128/apps</IconPath>
    <IconPath>/var/lib/flatpak/exports/share/icons/hicolor/scalable/apps</IconPath>
    <IconPath>$HOME/.local/share/flatpak/exports/share/icons/hicolor/128x128/apps</IconPath>
    <IconPath>$HOME/.local/share/flatpak/exports/share/icons/hicolor/scalable/apps</IconPath>
    <IconPath>/usr/share/icons/gnome/32x32/actions</IconPath>
    <IconPath>/usr/share/icons/gnome/32x32/apps</IconPath>
    <IconPath>/usr/share/icons/gnome/32x32/categories</IconPath>
    <IconPath>/usr/share/icons/gnome/32x32/status</IconPath>
    <IconPath>/usr/share/icons/hicolor/32x32/apps</IconPath>
    <IconPath>/usr/share/icons/hicolor/32x32/actions</IconPath>
    <IconPath>/usr/share/icons/hicolor/32x32/categories</IconPath>
    <IconPath>/usr/share/icons/hicolor/32x32/status</IconPath>
    <IconPath>/usr/share/icons/hicolor/scalable/apps</IconPath>
    <IconPath>/usr/share/icons</IconPath>
    <IconPath>/usr/share/pixmaps</IconPath>

    <!-- 2 workspaces, single row, scaled wallpaper -->
    <Desktops width="2" height="1">
        <Background type="scale">/home/epochryphon/Pictures/Wallpapers/hills.png</Background>
    </Desktops>

    <SnapMode distance="10">border</SnapMode>
    <StartupCommand>/home/epochryphon/.jwm/startup</StartupCommand>

    <!-- Keys: only non-stock bindings. Alt+F1 kept because stock is root:1. -->
    <Key mask="A" key="F1">root:0</Key>

    <!-- Super + arrows / PgUp / PgDn: Win7-style snapping -->
    <Key mask="4" key="Left">maxleft</Key>
    <Key mask="4" key="Right">maxright</Key>
    <Key mask="4" key="Up">maximize</Key>
    <Key mask="4" key="Down">minimize</Key>
    <Key mask="4" key="Prior">maxtop</Key>
    <Key mask="4" key="Next">maxbottom</Key>
    <Key mask="4" key="r">restore</Key>
    <Key mask="4" key="d">showdesktop</Key>

    <!-- Workspaces without a pager: Super+1/2 switch, Super+Shift+1/2 send -->
    <Key mask="4" key="#">desktop#</Key>
    <Key mask="4S" key="#">send#</Key>

    <!-- Mouse: desktop clicks dead, desktop scroll switches workspace.
         Everything else (title/border/buttons) uses JWM defaults. -->
    <Mouse context="root" button="1">none</Mouse>
    <Mouse context="root" button="2">none</Mouse>
    <Mouse context="root" button="3">none</Mouse>
    <Mouse context="root" button="4">ldesktop</Mouse>
    <Mouse context="root" button="5">rdesktop</Mouse>
    <!-- Keys: only non-stock bindings. Alt+F1 kept because stock is root:1. -->
    <Key mask="A" key="F1">root:0</Key>
    <Key mask="A" key="Left">ldesktop</Key>
    <Key mask="A" key="Right">rdesktop</Key>

</JWM>
