WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: config for labwc  (Read 1043 times)

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14851
config for labwc
« on: October 31, 2024, 09:37:23 AM »
Does anybody have a tinycore compatible config for the labwc wayland compositor, perhaps based on the x86_64 openbox-config extension by @polikuo?

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: config for labwc
« Reply #1 on: October 31, 2024, 10:15:30 AM »
Hi Juanito. I dual-boot TCL15 x86_64 with fluxbox and TCL15 x86_64 with labwc. I mostly use fluxbox but like to keep labwc around for wayland experiments.

This is my tinycore compatible labwc config (file location is ~/.config/labwc/rc.xml):

Code: [Select]
<?xml version="1.0" ?>
<labwc_config>

<keyboard>
<default />
<keybind key="d-W"><action name="Execute" command="xfe ~/Downloads" /></keybind>
<keybind key="h-W"><action name="Execute" command="xfe ~" /></keybind>
<keybind key="m-W"><action name="Execute" command="mnttool" /></keybind>
<keybind key="t-W"><action name="Execute" command="foot" /></keybind>
</keyboard>

<regions>
<region name="nice-spot" x="2%" y="5%" width="80%" height="80%"></region>
</regions>

<windowRules>
<windowRule identifier="" title="Calendar"><action name="ResizeTo" width="100" height="100" /><action name="MoveTo" x="1070" y="60" /></windowRule>
<windowRule identifier="" title="Save*"><action name="ResizeTo" width="900" height="550" /><action name="MoveTo" x="200" y="150" /></windowRule>
<windowRule identifier="" title="Open File"><action name="ResizeTo" width="900" height="550" /><action name="MoveTo" x="200" y="150" /></windowRule>
<windowRule title="Write:*"><action name="SnapToRegion" region="nice-spot" /></windowRule>
</windowRules>

<mouse>
<default />
<context name="Root">
<mousebind button="Left" action="Press">
<action name="Unfocus" />
</mousebind>
</context>
<context name="Title">
<mousebind button="Left" action="DoubleClick">
<action name="Execute" command="false" />
</mousebind>
</context>
</mouse>

</labwc_config>
« Last Edit: October 31, 2024, 10:21:36 AM by GNUser »

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: config for labwc
« Reply #2 on: October 31, 2024, 03:16:46 PM »
P.S. As I'm sure you noticed, I use the config file for custom keyboard shortcuts, custom window placements, and custom mouse-click actions. If no custom behavior is needed, labwc runs fine without a config file.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14851
Re: config for labwc
« Reply #3 on: November 01, 2024, 11:01:12 AM »
Perhaps I’m missing something, but without any files in ~/.config/labwc all I get is a right click menu with reconfigure and exit..

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: config for labwc
« Reply #4 on: November 01, 2024, 11:09:10 AM »
That's expected. labwc is radically minimalistic by design. To add entries to the right click menu you would edit ~/.config/labwc/menu.xml. Mine looks like this, for example:

Code: [Select]
<?xml version="1.0" ?>

<openbox_menu>
<menu id="root-menu" label="">
  <item label="Web browser"><action name="Execute" command="brave-browser --ozone-platform=wayland" /></item>
  <item label="Terminal"><action name="Execute" command="foot" /></item>
  <item label="Reconfigure"><action name="Reconfigure" /></item>
  <item label="Exit to console"><action name="Exit" /></item>
  <item label="Reboot"><action name="Execute" command="sudo reboot" /></item>
  <item label="Shutdown"><action name="Execute" command="sudo poweroff" /></item>
</menu>
</openbox_menu>
Do you think the labwc.tcz extension should come with a startup script that builds ~/.config/labwc/menu.xml based on what's available on the user's system? If so I can put one together and include it next time that I update the extension.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14851
Re: config for labwc
« Reply #5 on: November 01, 2024, 01:18:21 PM »
I guess it could include a terminal (foot or havoc), text editor (gedit?) file manager (emelfm3 or nautilus) and browser (Firefox) so things would work without Xwayland, but including everything available might be overkill?

I’m looking at aarch64 at the moment to see what waybar might bring (and still wondering about fltk-1.4 Wayland only).
« Last Edit: November 01, 2024, 01:20:23 PM by Juanito »

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: config for labwc
« Reply #6 on: November 01, 2024, 01:32:40 PM »
I guess it could include a terminal (foot or havoc), text editor (gedit?) file manager (emelfm3 or nautilus) and browser (Firefox) so things would work without Xwayland, but including everything available might be overkill?
Hi Juanito. My preference is to leave it up to the user to load preferred applications in those categories. User can then create a custom ~/.config/labwc/menu.xml so that their right-click menu shows the applications they like.

FWIW I personally like foot, gedit, xfe, and brave-browser. All of these work in a pure wayland environment except xfe, which I like enough that I don't mind the fact that it runs inside xwayland. labwc automatically opens X applications using xwayland in a way that's totally transparent to the user.
« Last Edit: November 01, 2024, 01:43:41 PM by GNUser »

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: config for labwc
« Reply #7 on: November 01, 2024, 02:19:21 PM »
While on the topic of configuring labwc, for the desktop to feel polished it should probably have a background image and a taskbar.

For setting a background image there's swaybg.tcz. For taskbar, current options in the x86_64 repo are sfwbar.tcz and waybar.tcz.

In labwc, startup commands go in the ~/.config/labwc/autostart file. This file itself does not have to have executable permission (i.e., 644 permissions on this file are fine). File could look like this, for example:

Code: [Select]
swaybg -i /path/to/some/nice/image.jpg &
sfwbar &

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14851
Re: config for labwc
« Reply #8 on: November 03, 2024, 05:43:36 AM »
So, after a little playing around in piCore64, here's an example labwc config:

Start labwc with:
Code: [Select]
sudo -- seatd -g staff -n /run/seatd.sock & XDG_RUNTIME_DIR=/run/user/1001 dbus-run-session labwc..dbus is required for waybar

/home/tc/.config/labwc/autostart:
Code: [Select]
wlr-randr --output HDMI-A-1 --mode 1920x1080@60Hz &
waybar >/dev/null 2>&1 &
swaybg -c '#87C6C9' -i /usr/local/share/pixmaps/logo.png -m center >/dev/null 2>&1 &
..set the screen size and start waybar. Start swagbg with tinycore wallpaper (minus gradient)

/home/tc/.config/labwc/environment:
Code: [Select]
XKB_DEFAULT_LAYOUT=gb
XKB_DEFAULT_MODEL=pc104alt
WLR_XWAYLAND=
..setup the keyboard and disable xwayland

/home/tc/.config/labwc/menu.xml:
Code: [Select]
<?xml version="1.0" ?>

<labwc_menu>
<menu id="root-menu" label="">
  <item label="Browser"><action name="Execute" command="firefox" /></item>
  <item label="Terminal"><action name="Execute" command="havoc" /></item>
  <item label="Text Editor"><action name="Execute" command="gedit" /></item>
  <item label="File Manager"><action name="Execute" command="nautilus" /></item>
  <item label="Reconfigure"><action name="Reconfigure" /></item>
  <item label="Exit"><action name="Exit" /></item>
</menu>
</labwc_menu>
..define some apps for the right-click menu - any native wayland or gtk3/gtk4 app should work.

/home/tc/.config/labwc/rc.xml:
Code: [Select]
<labwc_config>
  <desktops number="4" />
  <keyboard>
    <keybind key="W-1"><action name="GoToDesktop" to="1" /></keybind>
    <keybind key="W-2"><action name="GoToDesktop" to="2" /></keybind>
    <keybind key="W-3"><action name="GoToDesktop" to="3" /></keybind>
    <keybind key="W-4"><action name="GoToDesktop" to="4" /></keybind>
  </keyboard>
</labwc_config>
..define 4 workspaces
« Last Edit: November 04, 2024, 10:30:27 AM by Juanito »

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: config for labwc
« Reply #9 on: November 03, 2024, 07:04:12 AM »
Looks nice! Yes, all labwc configuration/customization happens in those four files.

I think TCL and labwc go well together. Both do only what the user tells them to, without any surprises or complications.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14851
Re: config for labwc
« Reply #10 on: November 04, 2024, 10:30:46 AM »
swaybg line added