diff options
author | Eric Hameleers <alien@slackware.com> | 2015-11-28 01:52:06 +0100 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2015-11-28 01:52:06 +0100 |
commit | 4d5cdc379e338c1c28f4d7d09226d4167a3f9e1e (patch) | |
tree | 95eba4e47f473c238361f19750cbd7d392a333e1 /xdm/Xsetup | |
download | liveslak-4d5cdc379e338c1c28f4d7d09226d4167a3f9e1e.tar.gz liveslak-4d5cdc379e338c1c28f4d7d09226d4167a3f9e1e.tar.xz |
Slackware Live Edition: initial commit.Beta2
This is Beta 2.
Read http://alien.slackbook.org/blog/slackware-live-edition-beta-2
for all the details.
Diffstat (limited to '')
-rwxr-xr-x | xdm/Xsetup | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/xdm/Xsetup b/xdm/Xsetup new file mode 100755 index 0000000..69a6d6d --- /dev/null +++ b/xdm/Xsetup @@ -0,0 +1,43 @@ +#!/bin/sh +# Borrowed from Arch Linux and adapted for Slackware. +# See https://aur.archlinux.org/packages/xdm-arch-theme/ + +# the root window should have this color +xsetroot -solid "#000000" -cursor_name left_ptr + +SVG_FILE=/etc/X11/xdm/liveslak-xdm/slackware_traditional.svg + +# identify resolution +declare -a RESOLUTION +RESOLUTION=( $(xrandr -q | head -n1 | sed -e 's/.*current \([1-9][0-9]\+\) x \([1-9][0-9]\+\).*/\1 \2/') ) + +CACHE_DIR=/var/cache/xdm-liveslak-theme +IMAGEFILE=${CACHE_DIR}/slackware_logo_${RESOLUTION[0]}x${RESOLUTION[1]}.png + +# create cache dir if necessary +if [[ ! -d ${CACHE_DIR} ]]; then + mkdir -p ${CACHE_DIR} +fi + +# check whether image file already exists +if [[ ! -f ${IMAGEFILE} ]]; then + rsvg-convert -a --background-color="#000000" -f png -w $((${RESOLUTION[0]}/3*2)) -o ${IMAGEFILE} ${SVG_FILE} +fi + +# try different methods to set the background +if which display >> /dev/null 2>&1; then + # imagemagick detected + display -background "#000000" -backdrop -window root ${IMAGEFILE}; +elif which feh >> /dev/null 2>&1; then + # feh detected + # feh gives error if $HOME isn't set, so... + HOME=/root feh --bg-center ${IMAGEFILE}; +elif which xv >> /dev/null 2>&1; then + # xv detected + # xv spits out an error when using -quit, but it still does the job, so... + xv -root -quit -rmode 5 ${IMAGEFILE} >> /dev/null 2>&1 +fi + +/etc/X11/xdm/liveslak-xdm/buttons & + +xclock & |