sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

index.md (5394B)


      1 xfce4-panel
      2 ===========
      3 
      4 Description
      5 -----------
      6 
      7 When xfce4 tools are on the system anyway, it might make sense to use the xfce4-panel in dwm.
      8 This patch modifies dwm, so that it treats any window with name `xfce4-panel` (default)
      9 as a status bar, i.e.:
     10 
     11 - it never has borders
     12 - it never has focus
     13 - always has y=0
     14 - it is never shown as active window in the tag indicators
     15 - it is shown on all tags (via a tag rule in the config)
     16 - it is ignored on `focusstack` (MOD+j / MOD+k)
     17 
     18 ![dwm_xfce4-panel.png](dwm_xfce4-panel.png)
     19 
     20 - The panel does act as systray for third party tools, i.e. the systray patch is no more required
     21 - Looks best when background is set to same color as the dwm statusline (black in the example)
     22 - Using a compositor you can dimm or completely hide it, when not hovered
     23 
     24 The patch has been created against dwm6.2.  
     25 
     26 Download
     27 --------
     28 
     29 * [dwm-xfce4-panel-20210701-67d76bd.diff](dwm-xfce4-panel-20210701-67d76bd.diff) (2021-07-01)
     30 
     31 Notes
     32 -----
     33 
     34 - The workspace switcher won't work interactively, but dwm's interactive tag indicators remain on the left anyway.
     35 - Some actions in the "session menu" applet (the one with your name as title) won't work out of the box. You might supply your own sub menu or modify the actions of the existing one.
     36 - The rest of xfce4's 40 or so panel apps _should_ work (if installed) and also custom "applets" (see below) are working 
     37 - Startup: A start via xinitrc should be fine. I use the [autostart](https://dwm.suckless.org/patches/autostart/) patch to start
     38   in background:
     39 
     40         sleep 0.3
     41         xfce4-panel --disable-wm-check
     42 
     43 
     44 Panel Config
     45 ------------
     46 
     47 **dwm**  
     48 In dwm's rules, the panel should be configured to be shown on all tags - see the patch.
     49 
     50 **xrandr**:  
     51 Since the panel will reside always at `y=0`, a matching xrandr screenlayout must contain `--pos 0x0` for the monitor where the panel should be shown. That monitor must be connected, otherwise the panel won't be visible or pop up in the middle of another monitor. When you unplug that monitor, you need to have a valid new screen layout loaded. I use the monitor marked `--primary`. The [`arandr`](https://christian.amsuess.com/tools/arandr/) tool will create valid configs. I always have a fallback layout, with the laptop display configured primary, at `0x0`.
     52 
     53     # Example:
     54     xrandr --output eDP-1 --primary --mode 1920x1080 --pos 0x0 --rotate normal
     55 
     56 You can verify your screen layout using e.g. the `xev` tool, which reports the mouse coordinates relative to root.
     57 
     58 **xfce4-panel config**:  
     59 The rest of the config is done via XFCE4's internal tools, available e.g. via `xfce4-settings-manager` -> panel:
     60 
     61 - Configure exactly one Panel, e.g. via `xfce4-settings-manager` -> `panel`
     62 - At Tab Display:
     63 
     64     - Mode Horizontal   
     65     - Output: Your primary monitor (with y=0). Panel will stay there(!)  
     66     - Lock Panel: false  
     67     - Row size: Should probably match height of dwm statusbar, which depends on your dwm font size.
     68     - Autom. increase the length: true  
     69     - Length: 1% (will auto adapt)  
     70 
     71 - At Tab Appearance:
     72 
     73     - Adjust icon size automatically  
     74     - Autohide when not hovered: Run a compositor e.g. `picom` and set panel's "leave opacity" to 0. That way you could have a minimalistic dwm statusbar normally and the full interactive status bar only on mouse over. I prefer to rather dimm it down to an unobtrusive 30%.
     75 
     76 Also the _content_ of the panel you configure "normally", i.e. by adding items in the panel's items tab or via [CLI tools](https://docs.xfce.org/xfce/xfconf/xfconf-query).
     77 
     78 Tips:
     79 
     80 - The warning `Failed to connect to session manager` at panel startup is normal. I do not advise to start `xfce4-session` from within dwm to fix it. This will try auto explore your available workspaces - and possibly conclude you have `2**9 * monitor count`, writing that back into the xfce4 config. I had to manually clean up the config via [xfconf](https://docs.xfce.org/xfce/xfconf/xfconf-query).
     81 - Using xfconf and the panel config backup/restore tool might be the best way to have *different* panel setups in xfce4 and dwm, should you want to use xfce4 as well, where people often run more than one panel.
     82 
     83 
     84 Below is a usage example for adding your own information into the panel.
     85 
     86 
     87 Optional: Using the `genmon` Applet
     88 -----------------------------------
     89 
     90 Most panels offer the possibility to include generic scripts output.  
     91 In `xfce4-panel` this is done by the panel item: "Generic Monitor" (genmon). It features output styled with pango markup and mouseover/onclick hooks.
     92 
     93 Here are some `genmon` script collections:
     94 - [xfce4-genmon-scripts](https://awesomeopensource.com/project/xtonousou/xfce4-genmon-scripts)
     95 - [xfce4-genmon-scripts-2](https://github.com/almaceleste/xfce4-genmon-scripts)
     96 - [xfce4-genmon-scripts-3](https://github.com/levimake/xfce4-genmon-panel-scripts)
     97 
     98 Manual is [here](https://docs.xfce.org/panel-plugins/xfce4-genmon-plugin/start#usage).
     99 
    100 Personally I wanted to have CPU monitor, which shows the name of current high cpu eater(s) if present (next to current load by core) and on mouseover remembers the top output from the most recent high load situation in the past:
    101 
    102 ![genmon.png](genmon.png)
    103 
    104 To get that, I cat the content of a file generated by this script, started in `autostart.sh` in the background:
    105 [cpu_mon.py](cpu_mon.py).
    106 
    107 
    108 Author
    109 -------
    110 * Gunther Klessinger <gklessinger[at]gmx.de>
    111 
    112