From 4d5cdc379e338c1c28f4d7d09226d4167a3f9e1e Mon Sep 17 00:00:00 2001 From: Eric Hameleers Date: Sat, 28 Nov 2015 01:52:06 +0100 Subject: Slackware Live Edition: initial commit. This is Beta 2. Read http://alien.slackbook.org/blog/slackware-live-edition-beta-2 for all the details. --- xdm/Xsetup | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 xdm/Xsetup (limited to 'xdm/Xsetup') 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 & -- cgit v1.2.3