Compare commits

...

13 commits

Author SHA1 Message Date
Tobias Powalowski
fb5226a748 start sway support 2023-07-10 14:14:34 +02:00
Tobias Powalowski
b790daf416 start sway support 2023-07-10 14:04:36 +02:00
Tobias Powalowski
13da00c3e7 start sway support 2023-07-10 14:02:29 +02:00
Tobias Powalowski
ee5877fd69 start sway support 2023-07-10 13:57:01 +02:00
Tobias Powalowski
dc917b3c55 start sway support 2023-07-10 13:55:31 +02:00
Tobias Powalowski
88fc96b6c8 start sway support 2023-07-10 12:30:09 +02:00
Tobias Powalowski
bc456dfeb0 start sway support 2023-07-10 12:27:08 +02:00
Tobias Powalowski
410eb22f78 start sway support 2023-07-10 12:02:14 +02:00
Tobias Powalowski
f848b2c0ca start sway support 2023-07-10 11:02:26 +02:00
Tobias Powalowski
39d1bf9d88 start sway support 2023-07-10 11:01:05 +02:00
Tobias Powalowski
9a4761d2c6 start sway support 2023-07-10 10:48:42 +02:00
Tobias Powalowski
7f1ef8bfaf start sway support 2023-07-10 10:45:36 +02:00
Tobias Powalowski
22eb0db0c6 start sway support 2023-07-10 10:44:16 +02:00
5 changed files with 63 additions and 3 deletions

View file

@ -22,6 +22,9 @@ _GNOME_PACKAGES="gnome-desktop-4 gnome-shell gnome-terminal gnome-control-center
### KDE/Plasma defaults
# KDE/Plasma packages
_PLASMA_PACKAGES="plasma-wayland-session plasma-desktop konsole kscreen kate dolphin powerdevil ark gwenview"
### SWAY defaults
# Sway packages
_SWAY_PACKAGES="sway swaybg foot bemenu-wayland j4-dmenu-desktop"
### Custom Graphical defaults
# Custom packages
_CUSTOM_XORG=""

View file

@ -11,6 +11,8 @@
. /usr/lib/archboot/update/gnome-wayland.sh
. /usr/lib/archboot/update/plasma.sh
. /usr/lib/archboot/update/plasma-wayland.sh
. /usr/lib/archboot/update/sway.sh
[[ -z "${1}" ]] && usage
while [ $# -gt 0 ]; do
case ${1} in
@ -19,6 +21,7 @@ while [ $# -gt 0 ]; do
-latest-install|--latest-install) _L_INSTALL_COMPLETE="1";;
-latest-image|--latest-image) _G_RELEASE="1" ;;
-xfce|--xfce) _L_XFCE="1" ;;
-sway|--sway) _L_SWAY="1" ;;
-gnome|--gnome) _L_GNOME="1";;
-gnome-wayland|--gnome-wayland) _L_GNOME_WAYLAND="1";;
-plasma|--plasma) _L_PLASMA="1" ;;
@ -47,7 +50,7 @@ if [[ -n "${_CUSTOM_X}" || -n "${_CUSTOM_WAYLAND}" ]]; then
_custom_wayland_xorg
fi
# Gnome, KDE/PLASMA or XFCE launch
if [[ -n "${_L_XFCE}" || -n "${_L_PLASMA}" || -n "${_L_GNOME}" || -n "${_L_GNOME_WAYLAND}" || -n "${_L_PLASMA_WAYLAND}" ]]; then
if [[ -n "${_L_XFCE}" || -n "${_L_SWAY}" || -n "${_L_PLASMA}" || -n "${_L_GNOME}" || -n "${_L_GNOME_WAYLAND}" || -n "${_L_PLASMA_WAYLAND}" ]]; then
if [[ -e "/.graphic_installed" && "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -lt 4413000 ]]; then
_hint_graphic_installed
else

View file

@ -9,7 +9,7 @@ _install_plasma_wayland() {
_start_plasma_wayland() {
echo -e "Launching \e[1mKDE/Plasma Wayland\e[m now, logging is done on \e[1m/dev/tty7\e[m..."
echo -e "To relaunch \e[1mKDE/Plasma Wayland\e[m use: \e[92mplasma-wayland\e[m"
echo "exec dbus-run-session startplasma-wayland >/dev/tty7 2>&1" > /usr/bin/plasma-wayland
echo "MOZ_ENABLE_WAYLAND=1 QT_QPA_PLATFORM=wayland XDG_SESSION_TYPE=wayland exec dbus-run-session startplasma-wayland >/dev/tty7 2>&1" > /usr/bin/plasma-wayland
chmod 755 /usr/bin/plasma-wayland
plasma-wayland
}

View file

@ -0,0 +1,16 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-2.0-only
# created by Tobias Powalowski <tpowa@archlinux.org>
_install_sway() {
_PACKAGES="${_WAYLAND_PACKAGE} ${_STANDARD_PACKAGES} ${_STANDARD_BROWSER} ${_SWAY_PACKAGES}"
_prepare_sway
}
_start_sway() {
echo -e "Launching \e[1mSway\e[m now, logging is done on \e[1m/dev/tty7\e[m..."
echo -e "To relaunch \e[1mSway\e[m use: \e[92msway-wayland\e[m"
echo "MOZ_ENABLE_WAYLAND=1 QT_QPA_PLATFORM=wayland XDG_SESSION_TYPE=wayland exec dbus-run-session sway >/dev/tty7 2>&1" > /usr/bin/sway-wayland
chmod 755 /usr/bin/sway-wayland
sway-wayland
}
# vim: set ft=sh ts=4 sw=4 et:

View file

@ -53,6 +53,7 @@ usage () {
if [[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -gt 2500000 ]]; then
echo -e " \e[1m-xfce\e[m Launch XFCE desktop with VNC sharing enabled."
echo -e " \e[1m-custom-xorg\e[m Install custom X environment."
echo -e " \e[1m-sway\e[m Launch Sway desktop."
[[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -gt 3400000 ]] && echo -e " \e[1m-custom-wayland\e[m Install custom Wayland environment."
echo ""
fi
@ -120,7 +121,7 @@ _download_latest() {
wget -q "${_SOURCE}${_LIB}/${i}?inline=false" -O "${_LIB}/${i}"
done
# update libs
LIBS="update.sh xfce.sh gnome.sh gnome-wayland.sh plasma.sh plasma-wayland.sh"
LIBS="update.sh xfce.sh gnome.sh gnome-wayland.sh plasma.sh plasma-wayland.sh sway.sh"
for i in ${LIBS}; do
wget -q "${_SOURCE}${_UPDATE}/${i}?inline=false" -O "${_UPDATE}/${i}"
done
@ -519,6 +520,7 @@ _install_graphic () {
[[ -n "${_L_GNOME_WAYLAND}" ]] && _install_gnome_wayland
[[ -n "${_L_PLASMA}" ]] && _install_plasma
[[ -n "${_L_PLASMA_WAYLAND}" ]] && _install_plasma_wayland
[[ -n "${_L_SWAY}" ]] && _install_sway
# only start vnc on xorg environment
echo -e "\e[1mStep 3/3:\e[m Setting up VNC and browser...\e[m"
[[ -n "${_L_XFCE}" || -n "${_L_PLASMA}" || -n "${_L_GNOME}" ]] && _autostart_vnc
@ -529,6 +531,7 @@ _install_graphic () {
[[ -n "${_L_GNOME_WAYLAND}" ]] && _start_gnome_wayland
[[ -n "${_L_PLASMA}" ]] && _start_plasma
[[ -n "${_L_PLASMA_WAYLAND}" ]] && _start_plasma_wayland
[[ -n "${_L_SWAY}" ]] && _start_sway
}
_hint_graphic_installed () {
@ -563,6 +566,19 @@ _prepare_plasma() {
fi
}
_prepare_sway() {
if ! [[ -e /usr/bin/sway ]]; then
echo -e "\e[1mStep 1/3:\e[m Installing Sway desktop now..."
echo " This will need some time..."
_prepare_graphic "${_PACKAGES}" >/dev/tty7 2>&1
echo -e "\e[1mStep 2/3:\e[m Configuring Sway desktop..."
_configure_sway >/dev/tty7 2>&1
else
echo -e "\e[1mStep 1/3:\e[m Installing Sway desktop already done..."
echo -e "\e[1mStep 2/3:\e[m Configuring Sway desktop already done..."
fi
}
_configure_gnome() {
echo "Configuring Gnome..."
[[ "${_STANDARD_BROWSER}" == "firefox" ]] && gsettings set org.gnome.shell favorite-apps "['org.gnome.Settings.desktop', 'org.gnome.Terminal.desktop', 'org.gnome.Nautilus.desktop', 'firefox.desktop', 'org.gnome.DiskUtility.desktop', 'gparted.desktop', 'archboot.desktop']"
@ -645,6 +661,28 @@ EOF
cp /etc/xdg/autostart/archboot.desktop /usr/share/applications/
}
_configure_sway() {
echo "Configuring Sway..."
echo "Enable bemenu..."
sed -i -e 's|^set $menu.*|set $menu j4-dmenu-desktop --dmenu=\x27bemenu -i --nb "#3f3f3f" --nf "#dcdccc" --fn "pango:DejaVu Sans Mono 12"\x27 --term="foot" --no-generic|g' /etc/sway/config
echo "Setting wallpaper..."
sed -i -e 's|^output .*|output * bg /usr/share/archboot/grub/archboot-background.png fill|g' /etc/sway/config
echo "Setting tango theme for foot..."
grep -q '\[main\]' /etc/xdg/foot/foot.ini ||\
echo "[main]" >>/etc/xdg/foot/foot.ini
grep -q 'include=/usr/share/foot/themes/tango' /etc/xdg/foot/foot.ini||\
echo "include=/usr/share/foot/themes/tango" >>/etc/xdg/foot/foot.ini
echo "Autostarting setup..."
grep -q 'exec foot' /etc/sway/config ||\
echo "exec foot -- /usr/bin/setup" >> /etc/sway/config
_HIDE_MENU="avahi-discover bssh bvnc org.codeberg.dnkl.foot-server org.codeberg.dnkl.footclient qvidcap qv4l2"
echo "Hiding ${_HIDE_MENU} menu entries..."
for i in ${_HIDE_MENU}; do
echo "[DESKTOP ENTRY]" > /usr/share/applications/"${i}".desktop
echo 'NoDisplay=true' >> /usr/share/applications/"${i}".desktop
done
}
_custom_wayland_xorg() {
if [[ -n "${_CUSTOM_WAYLAND}" ]]; then
echo -e "\e[1mStep 1/3:\e[m Installing custom wayland..."