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

    <!-- The root menu. -->
    <!-- CHANGED: auto-generated from /usr/share/applications/*.desktop.
         Re-runs on every jwm -restart / -reload. -->
    <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>

    <!-- Options for program groups. -->
    <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>

    <!-- Tray at the bottom. -->
    <!-- CHANGED: Pager and show-desktop button removed.
         Workspaces: Alt+arrows / Super+1,2. Show desktop: Super+D. -->
    <Tray x="0" y="-1" height="40" autohide="off" delay="1000">

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

    <!-- Visual 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>
            <Opacity>1.0</Opacity>
        </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>
      <Active>
        <Foreground>#FFFFFF</Foreground>
        <Background>#555555</Background>
      </Active>
      <Foreground>#FFFFFF</Foreground>
      <Background>#333333</Background>
    </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>

    <!-- Path where icons can be found. -->
    <!-- Flatpak app icons (system-wide and per-user installs) -->
    <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/256x256/actions</IconPath>
    <IconPath>/usr/share/icons/gnome/256x256/apps</IconPath>
    <IconPath>/usr/share/icons/gnome/256x256/categories</IconPath>
    <IconPath>/usr/share/icons/gnome/256x256/devices</IconPath>
    <IconPath>/usr/share/icons/gnome/256x256/emblems</IconPath>
    <IconPath>/usr/share/icons/gnome/256x256/mimetypes</IconPath>
    <IconPath>/usr/share/icons/gnome/256x256/places</IconPath>
    <IconPath>/usr/share/icons/gnome/256x256/status</IconPath>
    <IconPath>/usr/share/icons/gnome/32x32/actions</IconPath>
    <IconPath>/usr/share/icons/gnome/32x32/animations</IconPath>
    <IconPath>/usr/share/icons/gnome/32x32/apps</IconPath>
    <IconPath>/usr/share/icons/gnome/32x32/categories</IconPath>
    <IconPath>/usr/share/icons/gnome/32x32/devices</IconPath>
    <IconPath>/usr/share/icons/gnome/32x32/emblems</IconPath>
    <IconPath>/usr/share/icons/gnome/32x32/mimetypes</IconPath>
    <IconPath>/usr/share/icons/gnome/32x32/places</IconPath>
    <IconPath>/usr/share/icons/gnome/32x32/status</IconPath>
    <IconPath>/usr/share/icons/gnome/scalable/actions</IconPath>
    <IconPath>/usr/share/icons/gnome/scalable/apps</IconPath>
    <IconPath>/usr/share/icons/gnome/scalable/categories</IconPath>
    <IconPath>/usr/share/icons/gnome/scalable/devices</IconPath>
    <IconPath>/usr/share/icons/gnome/scalable/emblems</IconPath>
    <IconPath>/usr/share/icons/gnome/scalable/mimetypes</IconPath>
    <IconPath>/usr/share/icons/gnome/scalable/places</IconPath>
    <IconPath>/usr/share/icons/gnome/scalable/status</IconPath>
    <IconPath>/usr/share/icons/hicolor/256x256/apps</IconPath>
    <IconPath>/usr/share/icons/hicolor/256x256/mimetypes</IconPath>
    <IconPath>/usr/share/icons/hicolor/32x32/actions</IconPath>
    <IconPath>/usr/share/icons/hicolor/32x32/apps</IconPath>
    <IconPath>/usr/share/icons/hicolor/32x32/categories</IconPath>
    <IconPath>/usr/share/icons/hicolor/32x32/devices</IconPath>
    <IconPath>/usr/share/icons/hicolor/32x32/emblems</IconPath>
    <IconPath>/usr/share/icons/hicolor/32x32/mimetypes</IconPath>
    <IconPath>/usr/share/icons/hicolor/32x32/status</IconPath>
    <IconPath>/usr/share/icons/hicolor/512x512/apps</IconPath>
    <IconPath>/usr/share/icons/hicolor/512x512/mimetypes</IconPath>
    <IconPath>/usr/share/icons/hicolor/scalable/actions</IconPath>
    <IconPath>/usr/share/icons/hicolor/scalable/apps</IconPath>
    <IconPath>/usr/share/icons/hicolor/scalable/categories</IconPath>
    <IconPath>/usr/share/icons/hicolor/scalable/devices</IconPath>
    <IconPath>/usr/share/icons/hicolor/scalable/emblems</IconPath>
    <IconPath>/usr/share/icons/hicolor/scalable/mimetypes</IconPath>
    <IconPath>/usr/share/icons/hicolor/scalable/places</IconPath>
    <IconPath>/usr/share/icons/hicolor/scalable/status</IconPath>
    <IconPath>/usr/share/icons</IconPath>
    <IconPath>/usr/share/pixmaps</IconPath>

    <!-- CHANGED: 2 workspaces, no visible pager. -->
    <Desktops width="2" height="1">
        <Background type="scale">/home/epochryphon/Pictures/Wallpapers/hills.png</Background>
    </Desktops>

    <DoubleClickSpeed>400</DoubleClickSpeed>
    <DoubleClickDelta>2</DoubleClickDelta>
    <FocusModel>click</FocusModel>
    <SnapMode distance="10">border</SnapMode>
    <MoveMode>opaque</MoveMode>
    <ResizeMode>opaque</ResizeMode>
    <StartupCommand>/home/epochryphon/.jwm/startup</StartupCommand>

    <!-- 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">nextstacked</Key>
    <Key mask="A" key="F4">close</Key>
    <Key mask="A" key="#">desktop#</Key>
    <Key mask="A" key="F1">root:0</Key>
    <Key mask="A" key="F2">window</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>

    <!-- Super + arrows: 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>

    <!-- ADDED: workspace control without a pager.
         Super+1/2 = switch, Super+Shift+1/2 = move window there. -->
    <Key mask="4" key="#">desktop#</Key>
    <Key mask="4S" key="#">send#</Key>

    <!-- Mouse bindings -->
    <!-- Disable all mouse buttons on desktop -->
    <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>

    <Mouse context="title" button="1">move</Mouse>
    <Mouse context="title" button="2">move</Mouse>
    <Mouse context="title" button="3">window</Mouse>
    <Mouse context="title" button="4">shade</Mouse>
    <Mouse context="title" button="5">shade</Mouse>
    <Mouse context="title" button="11">maximize</Mouse>

    <Mouse context="icon" button="1">window</Mouse>
    <Mouse context="icon" button="2">move</Mouse>
    <Mouse context="icon" button="3">window</Mouse>
    <Mouse context="icon" button="4">shade</Mouse>
    <Mouse context="icon" button="5">shade</Mouse>

    <Mouse context="border" button="1">resize</Mouse>
    <Mouse context="border" button="2">move</Mouse>
    <Mouse context="border" button="3">window</Mouse>

    <Mouse context="close" button="-1">close</Mouse>
    <Mouse context="close" button="2">move</Mouse>
    <Mouse context="close" button="-3">close</Mouse>

    <Mouse context="maximize" button="-1">maximize</Mouse>
    <Mouse context="maximize" button="-2">maxv</Mouse>
    <Mouse context="maximize" button="-3">maxh</Mouse>

    <Mouse context="minimize" button="-1">minimize</Mouse>
    <Mouse context="minimize" button="2">move</Mouse>
    <Mouse context="minimize" button="-3">shade</Mouse>

</JWM>
