Skip to content

Commit

Permalink
add default labwc config
Browse files Browse the repository at this point in the history
  • Loading branch information
dajix350 committed Sep 13, 2024
1 parent 7140ff4 commit ecb89a4
Show file tree
Hide file tree
Showing 4 changed files with 238 additions and 0 deletions.
34 changes: 34 additions & 0 deletions includes.container/etc/xdg/labwc/autostart
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Example autostart file

# Set background color.
swaybg -c '#113344' >/dev/null 2>&1 &

# Configure output directives such as mode, position, scale and transform.
# Use wlr-randr to get your output names
# Example ~/.config/kanshi/config below:
# profile {
# output HDMI-A-1 position 1366,0
# output eDP-1 position 0,0
# }
# kanshi >/dev/null 2>&1 &

# Launch a panel such as yambar or waybar.
waybar >/dev/null 2>&1 &

# Enable notifications. Typically GNOME/KDE application notifications go
# through the org.freedesktop.Notifications D-Bus API and require a client such
# as mako to function correctly. Thunderbird is an example of this.
dunst >/dev/null 2>&1 &

# Lock screen after 5 minutes; turn off display after another 5 minutes.
#
# Note that in the context of idle system power management, it is *NOT* a good
# idea to turn off displays by 'disabling outputs' for example by
# `wlr-randr --output <whatever> --off` because this re-arranges views
# (since a837fef). Instead use a wlr-output-power-management client such as
# https://git.sr.ht/~leon_plickat/wlopm
swayidle -w \
timeout 300 'swaylock -f -c 000000' \
timeout 600 'wlopm --off \*' \
resume 'wlopm --on \*' \
before-sleep 'swaylock -f -c 000000' >/dev/null 2>&1 &
85 changes: 85 additions & 0 deletions includes.container/etc/xdg/labwc/environment
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
##
## Example ~/.config/labwc/environment file.
## Uncomment lines starting with one '#' to suit your needs.
##

##
## Use the XKB_DEFAULT_LAYOUT variable to set the keyboard layout. For example
## to start with Swedish keyboard layout set it to 'se'. If you are unsure what
## your country code is, refer to the layout section of:
## /usr/share/X11/xkb/rules/evdev.lst
##
## Multiple keyboard layouts can be set by comma-separating the country codes.
## If a variant layout is needed, the syntax is layout(variant)
## If multiple layouts are used, specify the toggle-keybind using
## XKB_DEFAULT_OPTIONS as show below.
##
## For further details, see xkeyboard-config(7)
##

# XKB_DEFAULT_LAYOUT=se
# XKB_DEFAULT_LAYOUT=se,us(intl)
# XKB_DEFAULT_OPTIONS=grp:alt_shift_toggle
# XKB_DEFAULT_OPTIONS=grp:shift_caps_toggle

##
## Force Mozilla software like Firefox and Thunderbird to use wayland backend.
## Firefox (>= v121) enables Wayland by default, but we include this note here
## for those on non-rolling distributions.
##

# MOZ_ENABLE_WAYLAND=1

##
## Set cursor theme and size. Find system icons themes with:
## `find /usr/share/icons/ -type d -name "cursors"`
##

# XCURSOR_THEME=breeze_cursors
# XCURSOR_THEME=capitaine-cursors
# XCURSOR_SIZE=24

##
## Disable hardware cursors. Most users would not want to do this, but if you
## are experiencing issues with disappearing cursors, this might fix it.
##

# WLR_NO_HARDWARE_CURSORS=1

##
## In order for labwc to work out of the box, the environment variable below
## is set to "1" by default to avoid menus with incorrect offset and blank
## windows with Java applications such as JetBrains and Intellij Idea.
## See https://github.com/swaywm/sway/issues/595
## labwc will not override any already set environment variables, so if you for
## some reason do not want this, then just set it to "0" (not recommended, but
## mentioned here for completeness).
##

# _JAVA_AWT_WM_NONREPARENTING=0

##
## This allows xdg-desktop-portal-wlr to function (e.g. for screen-recording).
## It is automatically set to "wlroots" by labwc though, so it is only
## included here for completeness. Again, labwc will not over-write an
## already set environment variable, so if you need it set to something else,
## then uncomment and adjust.
##

# XDG_CURRENT_DESKTOP=wlroots

##
## This causes a virtual output to be created automatically whenever there
## are no outputs around. This helps for cases like wayvnc so there is always
## an output available to connect to. The name can be chosen freely but there
## must be no duplicate output names, for this reason using VIRTUAL-x or a
## physical connector name like HDMI-A-1 is not recommended as wlroots may
## want to create outputs with those names later on which would then fail.
##
## Using an output name that starts with NOOP- has the additional benefit
## that wayvnc will detect it being a virtual output and allow clients to
## resize the output to match the client resolution.
##

# LABWC_FALLBACK_OUTPUT=NOOP-fallback

78 changes: 78 additions & 0 deletions includes.container/etc/xdg/labwc/menu.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>

<openbox_menu>
<!-- Note: for localization support of menu items "client-menu" has to be removed here -->
<menu id="client-menu">
<item label="Minimize">
<action name="Iconify" />
</item>
<item label="Maximize">
<action name="ToggleMaximize" />
</item>
<item label="Fullscreen">
<action name="ToggleFullscreen" />
</item>
<item label="Roll Up/Down">
<action name="ToggleShade" />
</item>
<item label="Decorations">
<action name="ToggleDecorations" />
</item>
<item label="Always on Top">
<action name="ToggleAlwaysOnTop" />
</item>
<!--
Any menu with the id "workspaces" will be hidden
if there is only a single workspace available.
-->
<menu id="workspaces" label="Workspace">
<item label="Move Left">
<action name="SendToDesktop" to="left" />
</item>
<item label="Move Right">
<action name="SendToDesktop" to="right" />
</item>
<separator />
<item label="Always on Visible Workspace">
<action name="ToggleOmnipresent" />
</item>
</menu>
<item label="Close">
<action name="Close" />
</item>
</menu>

<menu id="root-menu">
<item label="Web browser">
<action name="Execute" command="firefox" />
</item>
<item label="Terminal">
<action name="Execute" command="alacritty" />
</item>
<item label="Reconfigure">
<action name="Reconfigure" />
</item>
<item label="Exit">
<action name="Exit" />
</item>
<item label="Poweroff">
<action name="Execute" command="systemctl -i poweroff" />
</item>
</menu>

<menu id="some-custom-menu">
<!--
Creates menu title.
To create an empty header with no text,
set label=" ", not label=""
-->
<separator label="custom menu" />
<item label="Reconfigure">
<action name="Reconfigure" />
</item>
<item label="Exit">
<action name="Exit" />
</item>
</menu>

</openbox_menu>
41 changes: 41 additions & 0 deletions includes.container/etc/xdg/labwc/rc.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0"?>

<!--
This is a very simple config file with many options missing. For a complete
set of options with comments, see docs/rc.xml.all
-->

<labwc_config>

<theme>
<name></name>
<cornerRadius>8</cornerRadius>
<font name="sans" size="10" />
</theme>

<keyboard>
<default />
<!-- Use a different terminal emulator -->
<keybind key="W-Return">
<action name="Execute" command="foot" />
</keybind>
<!--
Remove a previously defined keybind
A shorter alternative is <keybind key="W-F4" />
-->
<keybind key="W-F4">
<action name="None" />
</keybind>
</keyboard>

<mouse>
<default />
<!-- Show a custom menu on desktop right click -->
<context name="Root">
<mousebind button="Right" action="Press">
<action name="ShowMenu" menu="some-custom-menu" />
</mousebind>
</context>
</mouse>

</labwc_config>

0 comments on commit ecb89a4

Please sign in to comment.