From 4a83f36e36d09bfca93a9f3b2cb55e08d5d13169 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Wed, 17 Jul 2019 01:42:43 +0200 Subject: [PATCH] various config options, documentation, xfce config --- Makefile | 4 +- config.example | 37 ++++++++- modules/default.mk | 76 +++++++++++++++++-- modules/nodm.mk | 26 +++++++ modules/xfce.mk | 6 ++ modules/xfce/etc/X11/Xresources/xscreensaver | 4 + modules/xfce/etc/X11/Xresources/xvkbd | 6 ++ modules/xfce/etc/X11/Xsession.d/10qtstyle | 1 + modules/xfce/etc/gtk-2.0/gtkrc | 1 + modules/xfce/etc/xdg/marblerc | 9 +++ modules/xfce/etc/xdg/mimeapps.list | 18 +++++ .../xfce4/panel/launcher-xvkbd/xvkbd.desktop | 5 ++ .../xfce/etc/xdg/xfce4/panel/whiskermenu-1.rc | 1 + .../xfce/etc/xdg/xfce4/terminal/terminalrc | 3 + .../xfconf/xfce-perchannel-xml/thunar.xml | 5 ++ .../xfce-perchannel-xml/xfce4-desktop.xml | 12 +++ .../xfce-perchannel-xml/xfce4-panel.xml | 64 ++++++++++++++++ .../xfconf/xfce-perchannel-xml/xfwm4.xml | 7 ++ .../xfconf/xfce-perchannel-xml/xsettings.xml | 46 +++++++++++ 19 files changed, 320 insertions(+), 11 deletions(-) create mode 100644 modules/nodm.mk create mode 100644 modules/xfce.mk create mode 100644 modules/xfce/etc/X11/Xresources/xscreensaver create mode 100644 modules/xfce/etc/X11/Xresources/xvkbd create mode 100755 modules/xfce/etc/X11/Xsession.d/10qtstyle create mode 100644 modules/xfce/etc/gtk-2.0/gtkrc create mode 100644 modules/xfce/etc/xdg/marblerc create mode 100644 modules/xfce/etc/xdg/mimeapps.list create mode 100644 modules/xfce/etc/xdg/xfce4/panel/launcher-xvkbd/xvkbd.desktop create mode 100644 modules/xfce/etc/xdg/xfce4/panel/whiskermenu-1.rc create mode 100644 modules/xfce/etc/xdg/xfce4/terminal/terminalrc create mode 100644 modules/xfce/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/thunar.xml create mode 100644 modules/xfce/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml create mode 100644 modules/xfce/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml create mode 100644 modules/xfce/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml create mode 100644 modules/xfce/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml diff --git a/Makefile b/Makefile index 78b065a..03fd52b 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ define SOURCES = deb http://cdn.debian.net/debian stretch main endef -PACKAGES := ${PACKAGES} apt btrfs-tools busybox-static bzip2 ca-certificates cron debian-archive-keyring deborphan firmware-linux-free gzip htop ifupdown init iputils-ping irqbalance isc-dhcp-client less make net-tools nmap ntpdate openssh-client psmisc rsync sshfs sudo systemd traceroute unzip vim wget wireless-tools wpasupplicant xz-utils zip +PACKAGES := ${PACKAGES} apt busybox-static debian-archive-keyring init systemd config.mk: cp "config.example" "$@" @@ -97,6 +97,7 @@ define SOURCES = deb http://raspbian.raspberrypi.org/raspbian stretch main non-free firmware rpi deb http://archive.raspberrypi.org/debian stretch main endef + PACKAGES := ${PACKAGES} firmware-brcm80211 libraspberrypi-bin libraspberrypi0 pi-bluetooth raspberrypi-bootloader raspberrypi-kernel _target: _umount _partcopy _config _install @@ -213,6 +214,7 @@ ${VOLUME}: .FORCE ! printf '%s\n' "$${VOLUME}" |grep -q '^/dev/' # abort if volume should be real device dd count=0 of="$${VOLUME}" # truncate dd bs=1M count=0 seek=$$((3 + ${BOOT_MB} + ${ROOT_MB})) of="$${VOLUME}" + chmod g+w "$${VOLUME}" ${PBOOT}: .FORCE ! printf '%s\n' "$${PBOOT}" |grep -q '^/dev/' # abort if volume should be real device diff --git a/config.example b/config.example index bcb984a..33c962e 100644 --- a/config.example +++ b/config.example @@ -1,7 +1,40 @@ -# image=disk.img squash=rootfs.squash raspi=raspi.img -# modules= +## Choose only on of the possible target types +# image=disk.img +# squash=rootfs.squash +# raspi=raspi.img +## Image size in MB. Needs to be able to hold all software. +# imagesize=2048 + +## Additional packages # packages=chromium,gimp + +## Comma separated list of config modules from modules/ directory +# modules=nodm,xfce + +## Root password will be salted and encrypted in image # rootpass=topsecret + +## Comma separated list of users to be set up. +## User logins will start out with an empty password +# users=adam,steve + +## Wifi configuration, if a Wifi password is given, WPA encryption will be used +## without the password, the system will try to connect to an open wifi # wifi=MyWiFi # wifipass=P4ssW0rD + +## Timezone as offered by Debians tzdata selection +# timezone=Europe/Berlin + +## Comma separated list of locales, first one will become default locale +# locales=de_DE.UTF-8,en_US.UTF-8 + +## If nodm is installed, you can choose a user to login automatically +## If no user is given here, then nodm will default to root +# nodm_user=adam + +## If the approxmodule is enabled, then one (and only one) apt-source +## can be choosen to install packages from +## See modules/approx.mk if you need more flexibility +# approx=http://localhost:9000/debian diff --git a/modules/default.mk b/modules/default.mk index 71ec864..4cbc7ea 100644 --- a/modules/default.mk +++ b/modules/default.mk @@ -1,27 +1,87 @@ +ifdef imagesize +ROOT_MB := $(shell printf '%i\n' "$$(( ${imagesize} - ${BOOT_MB} - 3 ))") +endif + +PACKAGES := ${PACKAGES} btrfs-tools bzip2 ca-certificates cron deborphan firmware-linux-free gzip htop ifupdown iputils-ping irqbalance isc-dhcp-client less make net-tools nmap ntpdate openssh-client psmisc rsync sshfs sudo traceroute unzip vim wget wireless-tools wpasupplicant xz-utils zip + ifdef packages -PACKAGES := ${PACKAGES} $(subst ${comma_},${space},${packages}) +PACKAGES := ${PACKAGES} $(subst ${comma_},${space_},${packages}) endif +export DEBCONF + +define DEBCONF := +keyboard-configuration keyboard-configuration/model select Generic 105-key (Intl) PC +keyboard-configuration keyboard-configuration/variant select English (US) - English (Macintosh) +endef + +.PHONY: _debconf_selections +_install: _debconf_selections +_debconf_selections: ${SYSROOT} + printf '%s\n' "$${DEBCONF}" |chroot "$${SYSROOT}" debconf-set-selections + +.PHONY: _timezone _locales + +ifdef timezone +define DEBCONF := +${DEBCONF} +tzdata tzdata/Areas select $(firstword $(subst /,${space_},${timezone})) +tzdata tzdata/Zones/Europe select $(lastword $(subst /,${space_},${timezone})) +endef +PACKAGES := ${PACKAGES} tzdata +_config: _timezone +endif + +ifdef locales +define DEBCONF := +${DEBCONF} +locales locales/locales_to_be_generated multiselect ${locales} +locales locales/default_environment_locale select $(firstword $(subst ${comma_},${space_},${locales})) +endef +#$(addsuffix ${space_}UTF-8,$(subst ${comma_},${space_}${comma},${locales})) +PACKAGES := ${PACKAGES} locales +_config: _locales +endif + +_timezone: ${CFGROOT} + rm "$${CFGROOT}/etc/timezone" + chroot "$${CFGROOT}" dpkg-reconfigure --default-priority -u tzdata + +_locales: ${CFGROOT} + rm "$${CFGROOT}/etc/default/locale" "$${CFGROOT}/etc/locale.gen" + chroot "$${CFGROOT}" dpkg-reconfigure --default-priority -u locales + +.PHONY: _rootpass _users + ifdef rootpass export rootpass -.PHONY: _rootpass _config: _rootpass -_rootpass: ${CFGROOT} - chroot "$${CFGROOT}" usermod -p "$$(openssl passwd -salt "$$(($${RANDOM-0} + 10))" "$${rootpass}")" root endif -ifdef wifi -export wifi -_config: ${CFGROOT}/etc/network/interfaces.d/wifi +ifdef users +_config: _users +endif +_rootpass: ${CFGROOT} + chroot "$${CFGROOT}" usermod -p "$$(openssl passwd "$${rootpass}")" root + +_users: ${CFGROOT} + #sed -Ei 's;^SHELL=/bin/sh$$;SHELL=/bin/bash;;' "${CFGROOT}/etc/default/useradd" + for u in $(subst ${comma_},${space_},${users}); do \ + chroot "$${CFGROOT}" useradd -m -s /bin/bash -p "$$(openssl passwd "")" "$$u"; \ + done + +ifdef wifi ifdef wifipass -export wifipass +export wifi wifipass ${CFGROOT}/etc/network/interfaces.d/wifi: ${CFGROOT} printf 'auto wlan0\nallow-hotplug wlan0\n\niface wlan0 inet dhcp\n' >$@ printf ' wpa-ssid "%s"\n wpa-psk "%s"\n' "$$wifi" "$$wifipass" >>$@ else +export wifi ${CFGROOT}/etc/network/interfaces.d/wifi: ${CFGROOT} printf 'auto wlan0\nallow-hotplug wlan0\n\niface wlan0 inet dhcp\n' >$@ printf ' wireless-ssid "%s"\n' "$$wifi" >>$@ endif +_config: ${CFGROOT}/etc/network/interfaces.d/wifi endif diff --git a/modules/nodm.mk b/modules/nodm.mk new file mode 100644 index 0000000..17b3556 --- /dev/null +++ b/modules/nodm.mk @@ -0,0 +1,26 @@ +ifdef raspi +PACKAGES := ${PACKAGES} nodm xserver-xorg-video-fbturbo xserver-xorg-input-evdev +else +PACKAGES := ${PACKAGES} nodm xserver-xorg-video-all xserver-xorg-input-all +endif + + +define DEBCONF := +${DEBCONF} +nodm nodm/enabled boolean true +endef + +ifdef nodm_user +_config: _nodm_user +define DEBCONF := +${DEBCONF} +nodm nodm/user string ${nodm_user} +endef + +endif + +.PHONY: _nodm_user +_nodm_user: ${CFGROOT} + rm "$${CFGROOT}/etc/default/nodm" + chroot "${CFGROOT}" dpkg-reconfigure --default-priority -u nodm + chroot "${CFGROOT}" adduser "${nodm_user}" video diff --git a/modules/xfce.mk b/modules/xfce.mk new file mode 100644 index 0000000..f16581a --- /dev/null +++ b/modules/xfce.mk @@ -0,0 +1,6 @@ +PACKAGES := ${PACKAGES} xfce4 xauth x11-xserver-utils x2x xvkbd blueman xfce4-terminal xfce4-clipman-plugin xfce4-whiskermenu-plugin thunar gvfs gvfs-backends gvfs-fuse xscreensaver + +.PHONY: _xfce +_config: _xfce +_xfce: ${CFGROOT} + cp -a modules/xfce/. "$${CFGROOT}" diff --git a/modules/xfce/etc/X11/Xresources/xscreensaver b/modules/xfce/etc/X11/Xresources/xscreensaver new file mode 100644 index 0000000..6c4d7e8 --- /dev/null +++ b/modules/xfce/etc/X11/Xresources/xscreensaver @@ -0,0 +1,4 @@ +xscreensaver.mode: one +xscreensaver.selected: 151 +xscreensaver.newLoginCommand: /usr/sbin/lxdm -c USER_SWITCH + diff --git a/modules/xfce/etc/X11/Xresources/xvkbd b/modules/xfce/etc/X11/Xresources/xvkbd new file mode 100644 index 0000000..3124803 --- /dev/null +++ b/modules/xfce/etc/X11/Xresources/xvkbd @@ -0,0 +1,6 @@ +xvkbd.modalKeytop: true +xvkbd.compact: true +xvkbd.secure: true +xvkbd.alwaysOnTop: true +xvkbd.wmToolbar: true + diff --git a/modules/xfce/etc/X11/Xsession.d/10qtstyle b/modules/xfce/etc/X11/Xsession.d/10qtstyle new file mode 100755 index 0000000..b44089a --- /dev/null +++ b/modules/xfce/etc/X11/Xsession.d/10qtstyle @@ -0,0 +1 @@ +export QT_STYLE_OVERRIDE=Breeze diff --git a/modules/xfce/etc/gtk-2.0/gtkrc b/modules/xfce/etc/gtk-2.0/gtkrc new file mode 100644 index 0000000..5109227 --- /dev/null +++ b/modules/xfce/etc/gtk-2.0/gtkrc @@ -0,0 +1 @@ +include "/usr/share/themes/Breeze/gtk-2.0/gtkrc" diff --git a/modules/xfce/etc/xdg/marblerc b/modules/xfce/etc/xdg/marblerc new file mode 100644 index 0000000..890f49d --- /dev/null +++ b/modules/xfce/etc/xdg/marblerc @@ -0,0 +1,9 @@ +[MainWindow] +Height 900=640 +Width 1440=1024 + +[MarbleWidget] +homeLatitude=52.5011 +homeLongitude=13.4658 +homeZoom=3050 +mapTheme=earth/openstreetmap/openstreetmap.dgml diff --git a/modules/xfce/etc/xdg/mimeapps.list b/modules/xfce/etc/xdg/mimeapps.list new file mode 100644 index 0000000..74bf88b --- /dev/null +++ b/modules/xfce/etc/xdg/mimeapps.list @@ -0,0 +1,18 @@ +[Added Associations] +application/ogg=vlc.desktop;audacity.desktop; +application/pdf=kde4-okularApplication_pdf.desktop; +audio/flac=vlc.desktop;audacity.desktop; +audio/mp4=vlc.desktop;audacity.desktop; +audio/mpeg=vlc.desktop;audacity.desktop; +audio/ogg=vlc.desktop;audacity.desktop; +audio/x-flac+ogg=vlc.desktop;audacity.desktop; +audio/x-m4b=vlc.desktop;audacity.desktop; +audio/x-ms-wma=vlc.desktop;audacity.desktop; +audio/x-opus+ogg=vlc.desktop;audacity.desktop; +audio/x-speex+ogg=vlc.desktop;audacity.desktop; +audio/x-vorbis+ogg=vlc.desktop;audacity.desktop; +text/html=firefox-esr.desktop;chromium.desktop;kde4-kfmclient_html.desktop;kde4-kate.desktop;kde4-kwrite.desktop;libreoffice-writer.desktop;kde4-okularApplication_txt.desktop;vim.desktop; +video/mpeg=vlc.desktop;audacity.desktop; +video/ogg=vlc.desktop;audacity.desktop; +video/x-ogm+ogg=vlc.desktop;audacity.desktop; +video/x-theora+ogg=vlc.desktop;audacity.desktop; diff --git a/modules/xfce/etc/xdg/xfce4/panel/launcher-xvkbd/xvkbd.desktop b/modules/xfce/etc/xdg/xfce4/panel/launcher-xvkbd/xvkbd.desktop new file mode 100644 index 0000000..094cfcc --- /dev/null +++ b/modules/xfce/etc/xdg/xfce4/panel/launcher-xvkbd/xvkbd.desktop @@ -0,0 +1,5 @@ +[Desktop Entry] +Version=1.0 +Name=Keyboard +Exec=/bin/sh -c "killall xvkbd || xvkbd" +Icon=blueman-keyboard diff --git a/modules/xfce/etc/xdg/xfce4/panel/whiskermenu-1.rc b/modules/xfce/etc/xdg/xfce4/panel/whiskermenu-1.rc new file mode 100644 index 0000000..864b771 --- /dev/null +++ b/modules/xfce/etc/xdg/xfce4/panel/whiskermenu-1.rc @@ -0,0 +1 @@ +favorites=libreoffice-startcenter.desktop,firefox-esr.desktop,clementine.desktop,marble.desktop,audacity.desktop,org.kde.kdenlive.desktop,blender.desktop,inkscape.desktop,org.kde.krita.desktop,xfce4-terminal.desktop diff --git a/modules/xfce/etc/xdg/xfce4/terminal/terminalrc b/modules/xfce/etc/xdg/xfce4/terminal/terminalrc new file mode 100644 index 0000000..a2256b7 --- /dev/null +++ b/modules/xfce/etc/xdg/xfce4/terminal/terminalrc @@ -0,0 +1,3 @@ +[Configuration] +BackgroundMode=TERMINAL_BACKGROUND_TRANSPARENT +BackgroundDarkness=0.850000 diff --git a/modules/xfce/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/thunar.xml b/modules/xfce/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/thunar.xml new file mode 100644 index 0000000..d601abf --- /dev/null +++ b/modules/xfce/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/thunar.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/modules/xfce/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml b/modules/xfce/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml new file mode 100644 index 0000000..6b96eb4 --- /dev/null +++ b/modules/xfce/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/modules/xfce/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml b/modules/xfce/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml new file mode 100644 index 0000000..19907e6 --- /dev/null +++ b/modules/xfce/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/xfce/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml b/modules/xfce/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml new file mode 100644 index 0000000..e1206fd --- /dev/null +++ b/modules/xfce/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/modules/xfce/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml b/modules/xfce/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml new file mode 100644 index 0000000..5b74cf3 --- /dev/null +++ b/modules/xfce/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- 2.39.2