The Temple of Fu

code, systems and games

Archive for March 2013

Slackware – Fluxbox (random background slideshow)

with one comment

I have used Fluxbox in the past and Loved It! At some point I decided to play with XFCE and meh, it’s ok {grin} I made the switch back recently to FB. As anyone who has used FB before it is a pretty barren environment to begin with but I did find a style I liked so I applied it but I was missing a nice background. You can set a background using the following (note some sites will say to use the backgrounds folder under ./fluxbox but I don’t, I am a rebel like that). Make sure that any images you put under this directory adhere to Unix file naming conventions (no spaces etc), I also do not do scaling on these images so what you put under there is what will be displayed, so get wallpapers that fit your resolution.

$fbsetbg -l path_to_image

I thought cool but I want rotating images every X minutes. I found a bash script on the web that I modified a little.


#!/bin/bash
# Reads a given directory and set a random
# wallpaper using the images on that dir.

WALLPAPERDIR="$HOME/wallpapers"

if [[ -d "${WALLPAPERDIR}" ]]
then
while(true)
do
files=$(ls "${WALLPAPERDIR}")
file_matrix=($files)
num_files=${#file_matrix[*]}
#feh --bg-scale
fbsetbg -c "${WALLPAPERDIR}/${file_matrix[$((RANDOM%num_files))]}"
sleep 10m
#sleep 5s
done
fi

exit 0

I left the original call to feh in there but commented it out, it is not part of the standard Slackware install and I could not find a package that I wanted to use, and really didn’t feel like making my own at this time. fbsetbg is part of the core install so that is good enough for me for right now, there was however one tiny little thing. After creating the script, allowing execution of it and then running it, I would receive a weird warning.

$chmod +x random_wallpaper_slideshow.sh
$~/chmod +x random_wallpaper_slideshow.sh
wmsetbg warning: could not open domain file /home/fu/GNUstep/Defaults/WindowMaker

Simply typing the following command in a terminal setup the needed directories so that the warning went away.
$ wmsetbg

Now I can run the following and get a nice wallpaper slideshow after logging in.
$ ~/scripts/random_wallpaper_slideshow.sh &

Instead of running the above command I opted for editing the following file.
~/.fluxbox/startup

My fluxbox startup file now looks like the following, every time I startx my script will run and provide me a nice slideshow.

#!/bin/sh
#
# fluxbox startup-script:
#
# Lines starting with a '#' are ignored.

# Change your keymap:
xmodmap "/home/fu/.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 &

# Start DBUS session bus:
if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
eval $(dbus-launch --sh-syntax --exit-with-session)
fi

# And last but not least we start fluxbox.
# Because it is the last app you have to run it with ''exec'' before it.

fluxbox &
fbpid=$1
# or if you want to keep a log:
# exec fluxbox -log "/home/fu/.fluxbox/log"

sleep 1
{
. ~/scripts/random_wallpaper_slideshow.sh &
} &

wait $fbpid

Hope this helps!

Advertisements

Written by lordfu

March 9, 2013 at 8:44 pm

Posted in Linux, Slackware

Slackware – Kernel Upgrade to 3.8.1

with one comment

I woke up late last night, 12PM EST, and after reading a post that kernel.org had upgraded their website I took a visit. Well, that led me to saying ‘Hey I should upgrade my kernel! I was running 3.4.X something or rather that comes with Slack 14, it was stable but I felt the need to break something! {grin}

Here’s what I did, note YMMV! I used Pats config for the 3.7.1.x64 kernel as a starting point instead of my existing.

As root:

#cd /usr/src

#wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.8.1.tar.bz2

#tar -xvf linux-3.8.1.tar.bz2

#rm linux
Removes the existing symlink

#ln -s linux-3.8.1 linux
Creates a new symlink pointing to your new linux source

#wget http://slackware.mirrors.tds.net/pub/slackware/slackware-current/source/k/config-x86_64/config-huge-3.7.1.x64

#cp config-huge-3.7.1.x64 linux/.config

#cd linux

#make oldconfig
I ran make oldconfig in the kernel source directory so that the defaults are used from the .config file you just installed.
Because your kernel sources are probably newer than the .config, there will be new options to choose from. You will only have to answer these (press ENTER for the default answers which are mostly fine, or M to build new drivers as modules).

#make bzImage modules

#make modules_install

#cp arch/x86/boot/bzImage /boot/vmlinuz-custom-3.8.1
Copies the new kernel file

#cp System.map /boot/System.map-custom-3.8.1
Copies the System.map

#cp .config /boot/config-custom-3.8.1
Backup copy of my kernel config

#cd /boot

#rm System.map
Deletes the old link

#ln -s System.map-custom-3.8.1 System.map
Creates a new link

Edit /etc/lilo.conf and added a new entry for your new kernel. Leave the old just in case!

#lilo

Reboot and enjoy! Hope this helps!

Resources:
Alien Bob

Note:
Doing this on a Slackware image I have running in VirtualBox caused my screen not to be fullsized and I also lost scrolling with my mouse,as well as the back button ability on my mouse. I upgraded VirtualBox to 4.2.8 r83876 and then recompiled the Guest Additions and all was good!

Written by lordfu

March 3, 2013 at 7:51 pm

Posted in Linux, Slackware

Slackware – What version am I running?

with one comment

I usually don’t run the latest release but I am instead only keeping my installed packages current. So how do you know which version of Slack you are actually running? Well here you go!

cat /etc/slackware-version

Hope this helps!

Written by lordfu

March 3, 2013 at 12:29 am

Posted in Linux, Slackware