tools-hardened/desktop: Adds ability to set wallpaper for fluxbox.

Previously, if you were to boot this image you would be greeted with
an error message telling you that the background could not be set.
To fix this the package eterm was added to the fluxbox world file
to be pulled in on build-time. However, this only solved the problem
of being unable to set the background manually. To have fluxbox set
it automatically the .xinit was altered to call "exec startfluxbox".
When fluxbox is called by that command it searches for and executes
the startup file located in ~/.fluxbox/. This commit also adds a
custom startup file which sets the background to the default background:
/usr/share/backgrounds/background.jpg. This commit also includes one
unrelated alteration to fluxbox-run.sh which changes the fluxbox init
file to look at the custom menu in /usr/share/fluxbox/usermenu instead
of ~/.fluxbox/my-menu.
This commit is contained in:
Devan Franchini 2014-05-07 16:56:36 -04:00
parent 408d3fffc6
commit b4c1ef5c2b
3 changed files with 35 additions and 7 deletions

View file

@ -0,0 +1,24 @@
#!/bin/sh
#
# fluxbox startup-script:
#
# Lines starting with a '#' are ignored.
# Change your keymap:
xmodmap "/home/thuser/.Xmodmap"
# Applications you want to run with fluxbox.
# MAKE SURE THAT APPS THAT KEEP RUNNING HAVE AN ''&'' AT THE END.
#
# unclutter -idle 2 &
# wmnd &
# wmsmixer -w &
# idesk &
exec fbsetbg -f /usr/share/backgrounds/background.jpg &
# And last but not least we start fluxbox.
# Because it is the last app you have to run it with ''exec'' before it.
exec fluxbox
# or if you want to keep a log:
# exec fluxbox -log "/home/thuser/.fluxbox/log"

View file

@ -38,6 +38,7 @@ sys-process/fcron
www-client/firefox
x11-base/xorg-server
x11-misc/slim
x11-terms/eterm
x11-terms/xfce4-terminal
x11-wm/fluxbox
xfce-base/thunar

View file

@ -26,18 +26,22 @@ setup_usergroups() {
cp -a thuser "${ROOTFS}"/etc/skel
cp -f files/usermenu "${ROOTFS}"/usr/share/fluxbox/
sed -i 's/^\/usr\/*.*/\/usr\/bin\/fluxbox/' "${ROOTFS}"/etc/skel/.xinitrc
mkdir -p "${ROOTFS}"/etc/skel/{Desktop,Documents,Downloads,Music,Pictures,Public,Templates,Videos,.ssh,.cache/dconf,.config/dconf}
cp -f files/fluxbox-startup "${ROOTFS}"/usr/share/fluxbox/startup
sed -i 's/^\/usr\/*.*/exec startfluxbox/' "${ROOTFS}"/etc/skel/.xinitrc
mkdir -p "${ROOTFS}"/etc/skel/{Desktop,Documents,Downloads,Music,Pictures,Public,Templates,Videos,.ssh,.cache/dconf,.config/dconf,.fluxbox}
chmod 700 "${ROOTFS}"/etc/skel/.ssh
wget -O "${ROOTFS}"/etc/skel/.config/dconf/user "${DCONF_LOCAL}"
wget -O "${ROOTFS}"/etc/skel/.cache/dconf/user "${DCONF_LOCAL}"
rm -rf "${ROOTFS}"/home/thuser
cp -a thuser "${ROOTFS}"/home/thuser
sed -i -e 's/^\/usr\/*.*/\/usr\/bin\/fluxbox/' "${ROOTFS}"/home/thuser/.xinitrc
sed -i -e 's/^\/usr\/*.*/exec startfluxbox/' "${ROOTFS}"/home/thuser/.xinitrc
cp -a files/{Encrypt,Save,Utilities} "${ROOTFS}"/home/thuser
rm -rf "${ROOTFS}"/home/thuser/Utilities/post_gnome3_install.sh
mkdir -p "${ROOTFS}"/home/thuser/{Desktop,Documents,Downloads,Music,Pictures,Public,Templates,Videos,.ssh,.cache/dconf,.config/dconf}
mkdir -p "${ROOTFS}"/home/thuser/{Desktop,Documents,Downloads,Music,Pictures,Public,Templates,Videos,.ssh,.cache/dconf,.config/dconf,.fluxbox}
cp -f "${ROOTFS}"/usr/share/fluxbox/{apps,init,keys,menu,overlay,startup,usermenu,windowmenu} /home/thuser/.fluxbox/
chmod 700 "${ROOTFS}"/home/thuser/.ssh
wget -O "${ROOTFS}"/home/thuser/.config/dconf/user "${DCONF_LOCAL}"
wget -O "${ROOTFS}"/home/thuser/.cache/dconf/user "${DCONF_LOCAL}"
@ -45,8 +49,6 @@ setup_usergroups() {
chroot "${ROOTFS}"/ chown -R thuser:thuser /home/thuser
sed -i 's/# \(%wheel.*NOPASSWD\)/\1/' "${ROOTFS}"/etc/sudoers
sed -i 's/^\/usr\/*.*/\/usr\/bin\/fluxbox/' "${ROOTFS}"/etc/skel/.xinitrc
mkdir -p "${ROOTFS}"/home/thuser/.fluxbox
cp -f files/usermenu "${ROOTFS}"/home/thuser/.fluxbox/my-menu
}
setup_confs() {
@ -57,7 +59,8 @@ setup_confs() {
sed -i '/# login_cmd.*Xsession/ a\login_cmd exec /bin/bash -login ~/.xinitrc' "${ROOTFS}"/etc/slim.conf
sed -i 's/^\(sessiondir.*\)/# \1/' "${ROOTFS}"/etc/slim.conf
sed -i '/# sessiondir.*/ a\sessiondir /etc/X11/Sessions' "${ROOTFS}"/etc/slim.conf
sed -i 's/^session\.menuFile.*./session\.menuFile: \~\/.fluxbox\/my-menu/' "${ROOTFS}"/usr/share/fluxbox/init
sed -i 's/^session\.menuFile.*./session\.menuFile: \/usr\/share\/fluxbox\/usermenu/' "${ROOTFS}"/usr/share/fluxbox/init
mkdir -p "${ROOTFS}"/usr/share/backgrounds/
wget -O "${ROOTFS}"/usr/share/backgrounds/background.jpg "${IMAGE}"
sed -i '/^SYNC/d' "${ROOTFS}"/etc/portage/make.conf