Pages

2015-01-25

Changing themes in Openbox

Skackware64 14.1, Openbox, tint2, conky, feh.
## After using three month almost only Slackware with my slightly-Steampunk theme, I got bored and recalled idea I had - to make script to start X+OB (without display manager) with visual theme I like at that moment, with choice of others.
So I made it happen. In most primitive bash (me - bash-n00b).

# There are one Chooser and four Swapper scripts (as I have currently four themes):
-- 1. Created conf-number file, like:
if [ ! -f obtheme/theme ]; then echo "1" > 'obtheme/theme' ; fi
Get the number:
theme=$(grep -o '[0-9]*' obtheme/theme)
Every time theme is chosen, new number is also written into theme-file.
Those above are for marking previously chosen theme ('if then echo') - and also to let wallpaper-randomizer script to know which one is current.
Then I set some variables;
did 'while' and 'if' between choices, 'read' those 'if'-s, and 'break'-ed with correct answer;
And final 'if-elif' then does
if ... ; then exec "ob-thx.sh"
with chosen theme-swapper script.

-- 2. Swappers
I Collected everything possible to ~/obtheme/xx folders. Like tint-stuff and wallpapers and conf files to be swapped.
For various reasons - there are either symlinks or files overwritten (respectively 'ln -sf' and 'cp').
- Two gtk confs (.gtkrc-2.0 and .config/gtk-3.0/settings.ini = gtk-theme swap);
- my wallpaper randomizer script for that theme (symlink). But - randomizer can also be modified to pick folder according to already existing theme-file number, and then there is no need to swap it | Edit - Done, see the end of the post |;
- .fehbg in ~/ (to pick up another wallpaper-folder);
- rc.xml (OB-theme swap) and autostart in ./config/openbox. Those are also symlinks which point to theme-specific files. Different tint2 and conky confs are opened from swapped auostart;
- and lastly, 'startx'. Or for debugging - as Slackware without display-manager doesn't want to log X-errors - startx 2>.xsession_errors

So, I now start my X either with alias 'sx' - no change, stright to X;
with 'sxz' - which opens up dialog of theme-change;
or, I can pass that and use aliases for swappers: sx1, sx2... .

For anyone fluent with bash - to make such scripts is totally no issue. What takes time is preparing themes - from various conf changes to actual pic-making or theme-tweaking.
But I have to say - it's most satisfactory to see my whole "desktop" instantly and totally changed.

Addon: Here is a simple script for swapping wallpapers inside the current theme wp-folder. Also, keyboard W+1 is mapped in rc.xml as 'swap desktop to first one and run randwp1.sh'.

#!/bin/bash
## very simple random wallpaper picker, through feh or nitrogen
## --------------------------

sp1="/home/user/obtheme/sp/wp"
sf2="/home/user/obtheme/sf/wp"
fan3="/home/user/obtheme/fan/wp"
nat4="/home/user/obtheme/nat/wp"

# theme number variable from theme file
theme=$(grep -o '[0-9]*' /home/user/obtheme/theme)
echo $theme
# directory containing images
DIR=$(if [ $theme -eq 1 ] ; then echo "$sp1" ; 
 elif [ $theme -eq 2 ] ; then echo "$sf2" ; 
 elif [ $theme -eq 3 ] ; then echo "$fan3" ; 
 elif [ $theme -eq 4 ] ; then echo "$nat4" ; 
 fi)
echo "$DIR"
# select a random jpg from the directory
PIC=$(ls $DIR/*.jpg | shuf -n1)
echo "$PIC"

# use nitrogen to set wallpaper
# nitrogen --set-scaled $PIC
# use feh
feh --bg-scale $PIC

exit 

2015-01-18

Slackware64 14.1 + new kernel

Yeah, compiled a new 3.14.28 kernel - in a bit leaner way than slackware generic is.
So here comes concisely how I did it.

# First, open up this page and read it - my description here is almost the same, with occasional addons. And - I did everything on desktop terminal until Nvidia drivers' reinstall (logout, console, init 3).

1. Download the source (and pgp .sign) from kernel.org, copy to /usr/src, unxz the source file (tar needed afterwards), then unpack source to folder. To be nice and orderly, do: rm linux && ln -s /usr/src/linux-3.14.28 linux
cd linux
zcat /proc/config.gz > /usr/src/linux/.config  # or use some other handy config...
make oldconfig  # to insert kernel changes into old config file.
make menuconfig # Which probably takes two hours at least. But it's worth to be alert and click everything - for not to miss, for example, your network drivers.
make bzImage modules
make modules_install
cp arch/x86/boot/bzImage /boot/vmlinuz-custom-3.14.28
cp System.map /boot/System.map-custom-3.14.28 
cp .config /boot/config-custom-3.14.28
  # instead of 'custom' comes of course your special name you gave to your kernel (when menuconfiging).
/usr/share/mkinitrd/mkinitrd_command_generator.sh -k 3.14.28
This nicy script gives you exact command for creating initrd. Do it.
cd /boot
There should be three links to: kernel, system.map and config. Change those to point to your new files (ln -sf filename link).
Done with the kernel.

2. There is link /etc/rc.d/rc.modules which points to old rc.modules-3.10.17; copy this old modules file, rename it according to new kernel modules folder name (or 'uname -r' - which you can't use as kernel is not yet installed :) and change rc.modules link to point to this new file.

3. Grub or Lilo - has to be rerun for introducing new kernel. I have Grub2 in Wheezy (which I still keep only for hosting my multiboot) - I mounted Wheezys' partition and simply edited /boot/grub/grub.conf file. And that was that.

4. GPG-check. (Additionally to AlienBobs' tutorial there is also nice explanation in kernel.org.)
wget http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.14.28.tar.sign
Put it into the same folder where you have linux-3.14.28.tar
gpg --verify linux-3.14.28.tar.sign linux-3.14.28.tar
What results 'no key', but there is id=6092693E , use this and import:
gpg --keyserver hkp://keys.gnupg.net --recv-keys 6092693E
gpg --verify linux-3.14.28.tar.sign linux-3.14.28.tar
"This key is not certified with a trusted signature" - let it be like that, done.

5. NVIDIA
Kernel 3.14 and nvidia 319, seems, are not friends - no compile, BUT newer 331.86 did the trick. Before run, delete /etc/X11/xorg.conf - and then let installer make a new one. Sometimes there is a difference - as X starting or not starting (missing screens). No, I do not know why it sometimes matters.
Last part in following is for compiling for not yet installed kernel.
sh NVIDIA-Linux-x86_64-331.89.run --kernel-name='3.14.28'
It compiled, but whined over wrong arch in  /usr/lib64/libEGL.la
Anyway - X started up. I checked aforementioned .la - and it appeared that Nvidia removed it totally. Found it in /var/log/nvidia/103, copied back and also deleted in it one dependency that was obviously 32bit... We'll see what happens next time when compiling.
According to web, reinstalling mesa also fixes .la issue.

But never mind.
I have my new kernel running and everything seems to function OK.

Slackware + apps and stuff

I happened to look around for some new apps and so on... Found some and installed.
So it seems to be a good opportunity to flash MY list of apps, and blab a bit of some of them. This list, of course, is not a template for greater awareness and being godlike, but it might give some app-ideas... Like I found when peeking into other people choices ...
And here, some bollocks then:

## The patient: Slackware64 14.1, Nvidia 331.86 binary, Openbox. My Slack-install was not the 'full' one, but rather castrated - I left out everything possible... Including vim&family - which means that dotnew didn't want to compare anything (missing vimdiff). But never mind - new config files are for promptly deleting anyway.
Not-full install means that I might mention some things as 'new' that normally get installed automagically.
- Usage of my Linux(es): Educational playing-around, no serious work done, strictly desktop. No plan to use vi or emacs, no apache et al, not even ssh and ntp; no social bullshit and fraternizing (skype, chats and so on).
So - rather simple setup with net, writing and graphic tools, and occasionally test-stuff (for example, see my silly tour with linux games)

## Beginnings of apps:
-- I always use stright Nvidia binary (sh NVIDIA....run). It blacklists nouveau, reboot, run it again, let it make conf for X. For n00bs: for every kernel or x-server upgrade - nvidia driver has to be recompiled!

-- nano is installed from ISO - so console is survivable without various vi-s;

-- slackpkg+ and sbotools - get package for the first one, and SlackBuild for the second beforehand, makes a little less fussing now.
Slackpkg+ is a wrapper for official slackpkg. It has the same tools, but it provides multi-repo capability. Ie, various ready-made packages can be retrieved from several repos (see slakfinder.org). As a bonus - playing around with slackpkg+ conf keeps you occupied for an hour, or more.
Sbotools is freebsd-like ports-script. It installs, removes and keeps account of your sbo packages. It also checks dependencies (provided those are notified in .info file). Means, makes life easier - a lot easier if install is of 8-10 depending sbo packages ...
Sbotools has .SlackBuild in slackbuilds.org and compiles easily, no deps.
Run sudo sboconf (all sbotools are sudo / su) first, change something - and you get /etc/sbotools/sbotools.conf file created. Now fill it according to wishes and documentation (man sbotools).
I find it smart to keep sbo tree (and distfiles) on different partition (not in default /usr/sbo) - the same goes for made packages.
sbosnap fetch, and off we go - sboinstall, sboupdate etc etc.
As a rule I check .SlackBuild file for compile flags - before I commit. I tend to change them flags occasionally. Means that in serious cases I also unpack source and check for all possible flags, run: ./configure --help .
NB! If using other partition - better mount it already in fstab with 'defaults' - to avoid that file manager (maybe) mounts it "safely" with 'noexec, nosuid' etc.

-- xdotool, wmctrl are helpers for certain things one can do in openbox menus.

-- xarchiver, xfce4-terminal, medit, spacefm+udevil, openbox (I want icons - dep: imlib2 and --enable-imlib2 \ in .SlackBuild too), obconf, tint2 (svn version, with launchers), conky (same with imlib2, but check .SlackBuild also for things you do not need - and '--disable'), compton, feh, gtk-nodoka-engine, various fonts, gksu.
There is no display manager and I startx (alias sx) from init 3.
As I copied all confs already earlier, my desktop is essentially finished.

## Second group, installs are already from terminal:
-- New kernel - if one feels like compiling one. The point - Slackwares' generic is really quite big and has very probably some useless stuff there. But, let's be honest - it doesn't matter - and whole compile-thing can be considered just a merry exercise of showing who is the boss.
Also do: lsmod and see if you have some pointless modules loaded (for example, I take down parallel-port, printer and some other things - either by blacklisting or in kernel).

-- firejail+firefox. "Firejail is a SUID security sandbox program..." - but take a look yourself, there is quite a lot of explaining available.

-- dotnew+meld+diffuse. No vim = no vimdiff. So I installed diffuse (sbo), and swapped every gvimdiff in /usr/bin/dotnew-gtk script to diffuse. Strange enough, it works.

-- mplayer+smplayer+volumeicon. The last one has to be ver .46 if staying with gtk-2, the later versions demand gtk-3.

-- qpdfviewer, FBReader, Geany. To mention - FBReader is nice lightweight epub and mobi reader. It remembers your last read page too.

## And, third - those things which come when really needed:
-- gparted, unetbootin, bleachbit, fslint, libreoffice, qbittorrent, galculator, gcolor2, calibre, convertlit, inkscape (gimp is in official ISO), sigil, clementine.

-- If slightly paranoid: rkhunter from sbo, and for quite nice simple tutorial looka here.
And others...

2014-11-08

Games + Slackware

Yes, something frivolous... And NO - NO STEAM games here, never.
But about installing free natural-linux games in Slackware 14.1 (64bit).
SBO = slackbuilds.org (buildscripts+source=compile)
SF = slakfinder.org (ready binaries=install)

# Battle of Wesnoth - can be easily installed from SF, Salix. There is also option to compile it from SBO, and tuning the build specifically.
deps: It might need lua (according to SBO, but not according to SF). I had lua installed previously, so I don't know.
- Wesnoth is 'turn-based tactical strategy game'. See here for more in-depth info.
Nothing more to say - I haven't played it yet.

# Tales of Maj'Eyal - Not so easy install at all. Has to be compiled from SBO, and has a bunch of deps: premake - SBO (deps: lua), OpenAL - SF binary, SDL2 + SDL2_ttf + SDL2_image - all three from SBO.
SDL2_ttf gave me error about missing/wrong libGL. Fixed it in usr/lib64/libGL.la - changed obviously wrong libdir='/usr/lib' to libdir='/usr/lib64', and compile finished without further problems. ... I have no idea why it had such a wrong address in libdir...
- Maj'Eyal is 'roguelike RPG, featuring tactical turn-based combat and advanced character building' - see here.
The game is quite enthralling, 'just one turn more' type. It's also not easy, and has various ways to die stupidly. For example: walking in sand-tunnels without digging worm ahead; lack of attention with bosses is often strightly fatal...

# Freeciv - Install is compile from SBO. No deps. Easy-peasy.
- Freeciv is 'a free turn-based multiplayer strategy game'. Has big and quite well-stocked site.
The game has several diffrent modes and mods, including civ1 and civ2. Default mode is not especially easy - certainly for those whos experience runs only in wimpy and feebleminded civ 4 and 5.
Anyway, confs are easily hackable - for example: nations' files reside in /usr/share/freeciv/nation; and in /usr/share/freeciv/default one can find all general conf files. And they all are plain txt.
At the same time, creating a new nation - by tutorial - gave somehow buggy result...
The games' gui is not especially good and easily-usable, but as a civ-game - it's very OK.

# FreeDoom - SBO, and what you get are wads only, engine has to be get separately. And it would be mightily good, if there are old Dooms', or Heretics', or Hexens' original wads available - those are also playable with zdoom or gzdoom engines.
So, pick one of them...
gzdoom seems to be newer: SBO, deps - fmodapi.
zdoom - SBO, and has more deps - TiMidity++, fmodapi, p7zip.
- Doom is a shooter - or should I say The Shooter, at least for me it was first ever game played overnights with sysadmin and some developers (right, over 20 years ago).
Take a look here.

# Lips of Suna - Well, that installation took me some 5 hours of silly wandering around. The game has to be compiled as is, no slackbuild scripts here. For guidelines see here.
Basically, by default it installs to /home/xxx/ :
cd lipsofsuna-X-X-X
./waf configure
./waf install
./lipsofsuna
Here are deps. All are available in SBO, thank god. Ogre compile, though, is long as shit.
Most entertaining was that 'lips...' didn't compile - with nicy orange-bold error. Let's cut it short and reveal my winning configure line:
LDFLAGS=-lboost_system ./waf configure --ogre-plugindir=/usr/lib64/OGRE
Part before 'configure' ensures compile, part after, that ./lipsofsuna also starts.
It bloody compiled, with one orange part (but not bold)... jeez. I am sure it wasn't worth of it. But I won the struggle! :)
- No idea what the game is about, but the word 'naked' in description got me.

# Summoning wars 5.6! - SBO. Pile of deps, for me it was - after previous games: freealut SF Slacky (deps: OpenAL), physfs SBO, CEGUI SBO, poco (deps: mysql-connector-c++, unixODBC, both SBO).
Tried to compile games' new ver.058... and no luck - cegui-084 compile crapped out with windowsy (irrelevant) message ... As this games' description hasn't any word 'naked' in it - I didn't see reason to spend more than an hour with this particular problem ... And stayed with old version - 056 - and readymade SlackBuild. CEGUI compile was slow like dead AND decomposed snail, almost like shitpile firefox ... poco was as bad - like bloody half an hour... physfs compile was short and nice. What a ... letdown..., for example ginormous gcc compiled only an hour in the same box...
a..n..d..I am already compiling sumwars! Lotsa green text! It even moves! err... slowly...! OHHHHH, it erred out, unbelievably, and for your convenience, last lines were:
collect2: error: ld returned 1 exit status
make[2]: *** [sumwars] Error 1
make[1]: *** [CMakeFiles/sumwars.dir/all] Error 2
make: *** [all] Error 2
doh!
| add next day| Fix was like that, in sumwars.SlackBuild:
-DCMAKE_CXX_FLAGS="-lboost_system -ldl" \   # added here '-ldl'.
That was that, compile finished and game started...
- 'Summoning Wars is an role-playing game'.
As all time went for compile, not for play... Only thing I can say just now - games' graphics is horrible, as expected.

| ADD |
# Naev - SBO (deps: OpenAL), two source files, naev and ndata are needed. It compiled/started with no whining...
- Naev is a 2D space trading and combat game. 
Take a look, see...

# Dink Smallwood. (Flare, Baldur's Gate)
Those three are vague future plans. If they, or something else, materialize , I ADD.

All-in-all: Native Linux games mentioned here
- look like shit of various degree,
- play good IF they are out of pre-alpha (infrequent miracle!),
- and install mostly ... like shit.
I am sure that next year is Linux-Desktop Year. :)