1
0
mirror of https://github.com/lxsang/meta-rpi-diya.git synced 2024-11-20 03:48:22 +01:00

add custom config for wayland compositor and sfwbar

This commit is contained in:
DanyLE 2023-07-26 23:21:06 +02:00
parent d659e76211
commit cf058762dd
10 changed files with 471 additions and 2 deletions

View File

@ -50,7 +50,7 @@ IMAGE_INSTALL:append = "libcurl \
rsync \ rsync \
coreutils \ coreutils \
wayland wayland-protocols \ wayland wayland-protocols \
labwc foot swaybg swayidle swaylock wlr-randr yambar wlopm\ labwc foot swaybg swayidle swaylock wlr-randr wlopm sfwbar \
gdbserver \ gdbserver \
" "

View File

@ -0,0 +1,217 @@
Set Term = "foot"
# Task Switcher
switcher {
interval = 700
icons = true
labels = false
cols = 5
}
function("SfwbarInit") {
SetBarId "bar-0"
SetLayer "top"
}
function("ToggleMinimize") {
[!Minimized] Minimize
[Minimized] UnMinimize
}
function("ToggleMaximize") {
[!Maximized] Maximize
[Maximized] UnMaximize
}
menu("winops") {
item("focus", Focus );
item("close", Close );
item("(un)minimize", Function "ToggleMinimize" );
item("(un)maximize", Function "ToggleMaximize" );
}
# Panel layout
layout {
button {
style = "launcher"
value = $Term
action = Exec $Term
}
taskbar {
rows = 1
css = "* { -GtkWidget-hexpand: false; }" # stretch horizontally
icons = true
labels = true
action[3] = Menu "winops"
action[2] = Close
}
tray {
rows = 1
}
}
#CSS
button#launcher, button#module{
padding: 0px 5px 0px 5px;
background: none;
border-style:none;
box-shadow: none;
}
window {
-GtkWidget-direction: bottom;
background-color: rgba(0,0,0,0.6);
border-color: rgba(0,0,0,0.3);
}
#hidden {
-GtkWidget-visible: false;
}
button#taskbar_normal grid {
-GtkWidget-hexpand: false;
padding-right: 0px;
margin-right: 0px;
}
button#taskbar_normal image, button#taskbar_active image, button#taskbar_normal:hover image {
-GtkWidget-vexpand: true;
box-shadow: none;
border: none;
border-image: none;
background-image: none;
background: none;
min-width: 24px;
min-height: 24px;
-gtk-icon-shadow: none;
}
button#taskbar_normal label, button#taskbar_active label, button#taskbar_normal:hover label {
-GtkWidget-vexpand: true;
-GtkWidget-hexpand: false;
padding-left: 0.75mm;
padding-top: 0px;
padding-bottom: 0px;
font: 0.3cm Sans;
}
button#taskbar_normal , button#taskbar_active , button#taskbar_normal:hover {
padding-left: 0.75mm;
padding-top: 0.5mm;
padding-bottom: 0.5mm;
background-image: none;
border-radius: 4px;
border-image: none;
-GtkWidget-hexpand: false;
-GtkWidget-vexpand: true;
background-color: rgba(119,119,119,0.2);
border-color: rgba(119,119,119,0.3);
box-shadow: none;
}
button#taskbar_active {
background-color: rgba(255,255,255,0.2);
border-color: rgba(255,255,255,0.4);
}
button#taskbar_normal:hover , button#taskbar_active:hover {
background-color: rgba(176,176,176,0.22);
border-color: rgba(234,234,234,0.44);
}
grid#switcher_active image,
grid#switcher_active {
min-width: 1.25cm;
min-height: 1.25cm;
border-image: none;
padding: 1.25mm;
background-color: #777777;
border: 0px;
box-shadow: none;
border-radius: 1.25mm;
-GtkWidget-hexpand: true;
}
grid#switcher_normal image,
grid#switcher_normal {
min-width: 1.25cm;
min-height: 1.25cm;
border-image: none;
padding: 1.25mm;
-GtkWidget-direction: right;
-GtkWidget-hexpand: true;
}
window#switcher {
border-style: solid;
border-width: 0.25mm;
border-color: #000000;
border-radius: 1.25mm;
padding: 1.25mm;
-GtkWidget-hexpand: true;
}
grid#switcher {
border-radius: 1.25mm;
padding: 1.25mm;
background-color: rgba(0,0,0,0.8);
border-color: rgba(119,119,119,0.8);
box-shadow: none;
-GtkWidget-hexpand: true;
}
button#tray_active,
button#tray_passive,
button#tray_attention {
background-image: none;
border: 0px;
padding: 0px 1px;
margin: 0px;
border-image: none;
border-radius: 0px;
outline-style: none;
box-shadow: none;
-GtkWidget-hexpand: true;
-GtkWidget-vexpand: true;
}
button#tray_active image,
button#tray_passive image,
button#tray_attention image {
min-width: 26px;
}
grid#layout {
padding: 0.25mm;
-GtkWidget-direction: right;
min-height: 30px;
}
menu {
background-color: rgba(0,0,0,0.8);
border-color: rgba(119,119,119,0.3);
box-shadow: none;
}
menuitem {
color: #ffffff;
}
menu image {
min-width: 24px;
min-height: 24px;
padding-right: 5px;
}
label {
font: 0.27cm Sans;
color: #ffffff;
text-shadow: none;
}
* {
-GtkWidget-vexpand: true;
}

View File

@ -0,0 +1,23 @@
DESCRIPTION = "sfwbar pannel for wayland"
LICENSE = "GPL-3.0-only"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-3.0-only;md5=c79ff39f19dfec6d293b95dea7b07891"
DEPENDS = "wayland wayland-native wayland-protocols"
SRCREV = "${AUTOREV}"
SRC_URI = "git://github.com/LBCrion/sfwbar.git;protocol=https;branch=master"
SRC_URI += " file://sfwbar.config "
S="${WORKDIR}/git"
inherit meson pkgconfig features_check
EXTRA_OEMESON += "--buildtype release"
do_install:append () {
install -d ${D}/${sysconfdir}/sfwbar/
install -m 0755 ${WORKDIR}/sfwbar.config ${D}/${sysconfdir}/sfwbar/
}

View File

@ -0,0 +1,38 @@
# Example autostart file
# Set background color
swaybg -i /etc/labwc/wpp.png >/dev/null 2>&1 &
wlr-randr --output DPI-1 --transform 90
# 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.
# mako >/dev/null 2>&1 &
# Lock screen after 1 minute; 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 60 'wlopm --off DPI-1' resume 'wlopm --on DPI-1' &
SFWBAR_CNF="/etc/sfwbar/sfwbar.config"
if [ -e "$HOME/.config/sfwbar/sfwbar.config" ]; then
SFWBAR_CNF="$HOME/.config/sfwbar/sfwbar.config"
fi
sfwbar -f "$SFWBAR_CNF"

View File

@ -0,0 +1,28 @@
# Example environment file
# This allows xdg-desktop-portal-wlr to function (e.g. for screen-recording)
XDG_CURRENT_DESKTOP=wlroots
# Set keyboard layout to Swedish
# XKB_DEFAULT_LAYOUT=se
# Set two keyboard layouts and toggle between them using alt+shift
# XKB_DEFAULT_LAYOUT=se,de
XKB_DEFAULT_OPTIONS=grp:alt_shift_toggle
# Force firefox to use wayland backend
# MOZ_ENABLE_WAYLAND=1
# Set cursor theme.
# Find icons themes with the command below or similar:
# find /usr/share/icons/ -type d -name "cursors"
XCURSOR_THEME=breeze_cursors
# Disable hardware cursors. Most users wouldn't want to do this, but if you
# are experiencing issues with disappearing cursors, this might fix it.
# WLR_NO_HARDWARE_CURSORS=1
# For Java applications such as JetBrains/Intellij Idea, set this variable
# to avoid menus with incorrect offset and blank windows
# See https://github.com/swaywm/sway/issues/595
# _JAVA_AWT_WM_NONREPARENTING=1

View File

@ -0,0 +1,53 @@
#!/bin/sh
#
### BEGIN INIT INFO
# Provides: labwc
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
### END INIT INFO
LABWC_USER=diya
LABWC_CONFDIR="/etc/labwc"
if test -e "/home/$LABWC_USER/.config/labwc" ; then
LABWC_CONFDIR="/home/$LABWC_USER/.config/labwc"
fi
killproc() {
pid=`/bin/pidof $1`
[ "$pid" != "" ] && kill $pid
}
read CMDLINE < /proc/cmdline
for x in $CMDLINE; do
case $x in
labwc=false)
echo "labwc disabled"
exit 0;
;;
esac
done
case "$1" in
start)
. /etc/profile
su - $LABWC_USER -c "labwc -C $LABWC_CONFDIR" &
;;
stop)
echo "Stopping Weston"
killproc labwc
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 { start | stop | restart }"
;;
esac
exit 0

View File

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<openbox_menu>
<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="AlwaysOnTop">
<action name="ToggleAlwaysOnTop" />
</item>
</menu>
<menu id="root-menu">
<item label="Terminal">
<action name="Execute" command="foot -t xterm-256color" />
</item>
<item label="Reconfigure">
<action name="Reconfigure" />
</item>
<item label="Exit">
<action name="Exit" />
</item>
<item label="Poweroff">
<action name="Execute" command="sudo /sbin/halt" />
</item>
</menu>
<menu id="some-custom-menu">
<item label="Reconfigure">
<action name="Reconfigure" />
</item>
<item label="Exit">
<action name="Exit" />
</item>
</menu>
</openbox_menu>

View File

@ -0,0 +1,45 @@
<?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>
<core>
<gap>10</gap>
</core>
<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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 KiB

View File

@ -1 +1,23 @@
PACKAGECONFIG:remove = " man-pages xwayland " PACKAGECONFIG:remove = " man-pages xwayland "
SRC_URI += " file://init \
file://autostart \
file://environment \
file://menu.xml \
file://rc.xml \
file://wpp.jpg \
"
do_install:append () {
install -d ${D}/${sysconfdir}/init.d
install -d ${D}/${sysconfdir}/labwc
install -m 0755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/labwc
install -m 0755 ${WORKDIR}/autostart ${D}/${sysconfdir}/labwc/
install -m 0755 ${WORKDIR}/environment ${D}/${sysconfdir}/labwc/
install -m 0755 ${WORKDIR}/menu.xml ${D}/${sysconfdir}/labwc/
install -m 0755 ${WORKDIR}/rc.xml ${D}/${sysconfdir}/labwc/
install -m 0755 ${WORKDIR}/wpp.xml ${D}/${sysconfdir}/labwc/
}
inherit update-rc.d
INITSCRIPT_NAME = "labwc"
INITSCRIPT_PARAMS = "start 9 5 2 . stop 20 0 1 6 ."