Pages

Showing posts with label Conky. Show all posts
Showing posts with label Conky. Show all posts

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 

2014-01-07

Second Conky for weather

I went even further with my blingish adventures... Somewhere - related to tweaking conky - I stumbled upon weather forecasts. The thing never interested me much - as I don't consider weather-forecast overly trustworthy activity, and also, I didn't feel need to complicate my Linux-wrestling with trifle things.
Well, it suddenly felt alright now.
Here it comes - very simple conky with very simple layout, and launched from Openbox root-menu.

Essential link. The same info can be found in Cruchbang forum. From here (or there) you can get scripts for automatic download of data and conkyrc-s for presenting it.
I didn't change the script (except the URL of weather-data page), but I changed conkyrc quite heavily. I didn't want pics and special fonts and stuff - I wanted it to be functional, period.

Currently it looks like that, but will be tuned a bit more. Screws are for fitting in with my slightly-steam-punkish theme.

No code comes here for conkyrc, but two very helpful links:

Essentially: go get script and conkyrc. Tune conkyrc. Almost done.
Almost, because maybe of interest is:

- getting weather-conky working and quitting according to need. I, for example, do not want it sillily hanging on desktop - temperatures doesn't change so fast that it should require permanent watch. 
And here comes code for that. Which is borrowed in very big extent from Ubuntu forum.
/bin/wconky.sh - checks for weatherconkys' pidfile existence in folder where it's created. If it's already there, kills conky, if it's not there, starts conky and writes new pidfile.


#!/bin/bash
# ----------
# Simple script to start/kill weather conky

# folder where script is and data will be
basedir="/home/user/accuweather_conky/"
# pidfile name
pidfile="$basedir/weatherconky.pid"
if [ ! -e "$pidfile" ]
   then
   PROG="conky -c /home/user/.conkyrc_acc_int"
   $PROG &
   PID=$!
   echo $PID > "$pidfile"
else
   pidkill=`cat $pidfile`
   echo $pidkill
   kill -9 $pidkill
   rm $pidfile
fi

exit 0

Why this pidfile stuff? Beacuse I already have one conky started from autostart, with nice minimal sys-info, and I don't want that one killed (with killall). And naturally I am too lazy for pgrep and manual kill -9.

I stuck the script into main OB menu, just before 'exit'. No mysteries here: simple 'sh wconky.sh' as the execute command.
And that's it. Click once - get weather, click second time - no weather.
It was mildly interesting thing to fiddle with. It's usefulness is still in doubt.

Tint2 launcher, screwed

... and Conky screwed too

So I played with wallpapering Openbox, one thing led to another and I decided to amuse myself with panel-decorating, bitmapwise.
Tint2 doesn't support adding image as a panel background and consequently - only option is to stick 'panel' onto wallpaper. Easiest to do it is with layered Gimp file - so you can shuffle your wallpapers under panel and then export them as paneled wallpapers.
Now, what I wanted to do, was very slightly steampunkish appearance. Nothing overwhelmingly fancy like brass pipes, cogwheels, rayguns etc. 'Classic' SPs enormously overstuffed spaces are not my cup of tea.
I am not going to explain my confs' parameters here. Tweaking is reasonably easy thing to do - if using material here (tint2), and here (conky), and here (conky).

It came out like that:
-- wallpaper and 'panel'-ribbon below tint and conky are one jpg.

-- Left side, width 71% - is Tint2. All on-top backgrounds and borders are done by tint and so, easily tunable. Launcher has 5 png-icons.
- Left screw in launcher opens Openbox menu (xdotool key super+q
as exec in obmenu.desktop). Desktop file has to be made. Keybind itself has to be also defined, of course, in rc.xml (for 'root-menu', and here the same key is 'W-q'). Xdotool might not be installed by default (it is in Crunchbang and Vsido). In Slackware it is not installed, but can be made from SBO .
- Right screw is 'show/hide desktop', also through xdotool, key 'super+d'('W-d' in rc.xml).
As both those actions are quite pointless (why not to use keybinds stright...), then other tasks can be put here - exit script, weather conky, or whatever.
When making screws or other tiny icons - make png-s bigger with transparent padding, it gives bigger clickable area. Those here are 16px visible, but 24px with transparency.
Whole tint-tuning is simple playing around with numbers and colors (gcolor2 helps with choosing colors). Though, this play-around takes considerable amount of time...
... Of easy tunability - I haven't yet found error-proof way to restart tint (to see changes). For example:
'killall tint2' and start = corrupted taskbar/tasks (double?)
'kill -9 tint2' and start = no systray items
'killall -SIGUSR1 tint2' and start = corrupted systray (double?)
So, after a while I end up doing logout/login, and then decide that's enough of tint ...


-- Right side, 477px wide - Conky. Conky supports background images. So this dark-brown background-with-screws png-file sits in Conky.
I have to say - it took me some time to get Conkys' conf right. Partly because Conky (also) is not loading everything anew when conf is saved and Conky refreshes. Took me some time to realize that... Better to go for killall-method.
Key thing here is to comment those
#own_window_argb_visual yes
#own_window_argb_value 0
#own_window_colour 534821

and leave the next one working and 'yes'
own_window_transparent yes
Beacuse 'argb' things make your image transparent too...

Tuning conky is a bit trickier than tuning tint2. When pressed to this narrow form, quite many numbers have to be expressly '0', like border_inner_margin 0 for example. And see CPU-usage - it has to have spare space to expand. When numbers get into tens, you don't want your whole conky jumping bigger and hitting volumeicon or whatever.
Oh, and those screws here are just decorations.
What complicated things for me was - I didn't want to add panel to every wallpaper. So it turned to balancing act between tint on relatively light panel and tint on relatively dark wallpapers. It boiled down to playing with colors, and using upper layer (tint, conky) backgrounds without very much of transaparency.

And conclusion: oldish-90s-looking panel can be done with tint and conky. Also, I really like the idea of using screws as launchers. :)
Oh, and - do really use those tint and conky links, and info there - as all possible commands are NOT included in default conf files.
| NB! As it was my first time to include pics, I was quite annoyed when I got persistent error with inserting pics (impossible to insert)... Turned out that Googles' spymasters want popups and all cookies enabled... So I installed separate browser, all security-panties down, just for 'insert pic', and nothing else. But cookies will be deleted afterwards anyway. Quite, quite irritating. |

2013-04-19

Add Openbox session to Xubuntu

Collected notes and Walkthrough - how I did it.
 
For help and info, excellent places are: Crunchbang forum and Openbox Wiki.

I already had configured / tweaked Xfce side of Xubuntu - so 'restricted extras', Icedtea etc were already installed, as were done other 'first things'.

In Xfce session, open your terminal and type:
sudo apt-get install openbox obconf
Logout and login to new Openbox session.
What you find is black, empty screen. It is like that - so fearlessly right-click on blackness, open terminal and continue:

sudo apt-get install menu
cp /var/lib/openbox/debian-menu.xml ~/.config/openbox/debian-menu.xml
cp /etc/xdg/openbox/menu.xml ~/.config/openbox/menu.xml
cp /etc/xdg/openbox/rc.xml ~/.config/openbox/rc.xml
openbox --reconfigure
# previous part installed debian menu and copied all 
relevant menu files to your home.
# now, install also Openbox menu editor
sudo apt-get install obmenu

Take a look at your ./config/openbox/rc.xml - there are various parts of interest; like key and mouse bindings, general window conf and reference (a must) to menu.xml file. Investigate.
Then open up menu.xml - either in freshly installed obmenu or in editor. That's almost empty too! Right, it is - and you can proceed now in several ways:
1. Create new menu section from debian-menu (where things are distributed in most bizarre way). Re-arrange items to their proper places in the menu. It takes time..., --reconfigure often and take a look what happens - copy/paste errors are easy to come.
2. There are menu-related pipemenus in Openbox Wiki. Unfortunately I didn't install them but, maybe they are of help when creating your menu.
3. I took most of menu from my installed Vsido (tweaked already, of course, according to my installs/uninstalls), and pasted it into new menu.xml. Had to make some 10 corrections in items (no sweat). Also, I had 'iconified' whole Vsido menu before (2-3 hours of hard work), I really didn't want to do that again...
Syntacs for adding icons: item icon="/home/yourname/.icons/themename/apps/iconname.png" label="Appname".
Simply add your icon=absol.address into item tags. Easy, but yes, it takes time.

It's reasonable to pair your menu-building with installing - so you don't forget what you added.
1. Things to add what should have been already installed in Xfce (here are also things I personally like and install - question of choice):
synaptic, spacefm (a file manager better than Thunar, has to be taken from here), medit (an editor better than Leafpad), xfce4-terminal, xfce4-taskmanager, icedtea, bum (Bootup Manager, lets you add and remove early startup things), bleachbit (cleaner), gdebi-gtk (might be already installed out-of-box), gparted.
2. Install now: gtk-chtheme and/or lxappearance, update-alternatives, xxkb (how to here), volumeicon-alsa (if going for alsa).
Additionally: ipkungfu firewall (how to), maybe clamav+clamtk antivirus - to be in safe side with usb-s. Also - for more nerdy pro-look: htop. And for syncing and backups and creating your own distro: gsync, fsarchiver, remastersys (looong and complicated theme, do google).

When finished with menu - to great satisfaction and even greater relief, start with other bits of desktop: open ./config/openbox/autostart and start-up some more apps.
Install: tint2 (panel, if one doesn't want to use already present Xfce-panel), nitrogen (wallpaper manager), conky (fancy graphical systeminfo on desktop), compton (compositor). They all have manual config editing only, but there are lot of tutorials/help available.
Config files go: ./config/tint2/tint2rc, ./config/nitrogen/nitrogen.cfg (I think it was auto-created), .conkyrc, .compton.conf. It's probably best to find those files in web and then tweak them according to your fancy. I, again, ripped them from my Vsido installation.
Then you have to stick proper commands to autostart file. Here is one autostart which has almost all included - tweak and shape it according to your situation. Both Tint and Conky take -c parameter for pointing to conf file, like:
(sleep 1s && -c ~/.conkyrc_upleft) &
So you can make several conf files and switch between them.
Spacefm can be started as daemon (helps start speed, with mounting and unmounting and whatnot): spacefm -d. Or, it can be used as (minimal) desktop manager.
For Conky you probably have to install lm-sensors (terminal command is 'sensors', by the way).
Logout/login... ? Sure, everything looks good and somehow more presentable. That's it for first phaze.

Now, what else to install? Openbox themes, of course. Which are easily tweakable... gcolor2 helps to find new exciting colors. Crystalcursors? Suckless-tools to go for more nerdiness?
Or, more practically, wicd (network tool) and/or samba (network tool for linux+windows mixed)?

One more interesting thing to do. Let's make Main Menu to launch from Tints' Launchers and let's make sure that right click on desktop opens our whole menu.
Your rc.xml has to have, and sorry - I can't show xml here, whole thing goes crazy... :
keybind key="A-C-q" with menu-def root-menu.
And also mousebind action="Press" button="Right" with menu-def root-menu.
Now install: sudo apt-get install xdotool wmctrl
Create a folder ./config/tint2/.tint2launchers. Create launchers you want to appear in your Tint launcher there (copy them from your .local/share/applications). Only one that really has to be created is your menu.desktop:
[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Openbox Menu
Exec=xdotool key ctrl+alt+q
Icon=yourfavoritemenuicon.png
NoDisplay=false
Edit tint2rc file: there has to be 'L' in panel defs block (L=Launcher); and under Launchers block: launcher_apps_dir = /home/yourname/.config/tint2/
It's also possible to use a launcher-script for more 'docky' behaviour
And with the same method you can create missing 'show desktop' launcher-icon (exec=xdotool key super+d)

Additionally: Read about relations/fixes of Compton and multimedia
I tend to remove pulseaudio, and install alsa only. How to here

AND FINALLY: Logout and a bunch.
Fresh Openbox comes with Restart and Exit items at bottom of the Menu. The first one didn't work for me at all, the second one did (and it means 'logout', by the way). Missing, obviously, are Shutdown (and Suspend + Hibernate, if we talk of laptops).
I installed script called Oblogout, but also, only thing that worked was Logout. Then I copied 'vsido-exit' script from /usr/bin/ of my Vsido install. And it worked like charm. It's not fancy-looking and missing Hibernate, but it's OK with me. Abstractedly, in Xubuntu, you have to have a script that doesn't have bits like 'gdm' and 'hal' in it. 'dbus', of the contrary, is a desirable bit.

That's it. Except strange case of two apps persistently missing few icons, everything is mint for me.

2013-03-17

Vsido, overview and tips

I happened to visit the blog of IgnorantGuru. I followed a news-lead to IGurus' article about the current state of Linux. It was quite illuminating reading, especially, because I myself had started to think quite similar dark thoughts about how Linux development is being strangely rotten last two years or so.

And when clicking around there I found myself in place called vsido.org.
It is rather unpretentious home of very fresh Debian Sid distro called Vsido. It compares itself to Crunchbang (a scary thing to n00b like me). Despite that I downloaded, made USB (Unetbootin) and installed - successfully.

Install was kinda usual, maybe a bit longish, but nothing overly scary.
I installed Vsidos' grub to its' root, updated my master-bootloader  and booted smoothly to Vsido. Lightdm is for login.
First-time desktop greets you with more-than-nice script with various options: system updater, installer (printer, java, LibreOffice, dev-packs, OpenSSH, LAMPStack, and couple of other things).
There are three sessions installed:
- Xfce session has Conky ribbon on uppper-edge and tint2-dock bottom-edge. Main menu opens from desktop right-click or from launcher in dock.
- Openbox looks exactly the same.
- Fluxbox looks also the same - but with graphical glitches and strange behaviour. Removed it promptly. (Edit: Fluxbox in next mini-release ISO didn't have those problems.)
- And there is 'default session' - Openbox again (which changed to Fluxbox in later releases). When exiting from there with 'Restart' it totally froze...
It's impossible to install some Xfce panel plugins... and trash plugin simply didn't work | Edit: Trash didn't work because I replaced Thunar with Spacefm and Xfce trash plugin is connected only with Thunar. But Spacefm has also its own trash-plugin) Edit |.
Then there are currently three upgrades which doesn't upgrade because of dependency problems... That's Sid, alright.

First things - get into virtual terminal (CtL+ALT+F1), sudo su, and run smxi script. And READ what happens, and respond correctly (or else!).
OK then, everything installed, including new freshly installed video driver. Awesome script!

After that, I did the following:
- Removed Tint2 from Xfce (and 'kill panel script') - took them off from 'Startup'. Created new xfce panel, confed it.
| Edit:  And afterwards changed back to tint2. Retaining uniform look over your various desktops is actually a good thing. Edit |
- Shortened Conky info-strip - deleted some things in ~/.conkyrc.
- Synaptic 'Quick Search' field was missing. I had encountered this before and always thought its 'silly Synaptic different-version thingy'... But, it's not.
What you need to do is:
sudo apt-get install apt-xapian-index
#after that might need also
sudo update-apt-xapian-index -vf

Open Synaptic after that and it sprouts new nice quick-search field!
Additionally: If your Synaptic suddenly is NOT starting from Menu (and when starting it in terminal with the same command, asks USER-passwd): Change launcher command (synaptic pkexec) to gksudo synaptic.
- Make Spacefm to your default File Manager in Xfce too. It trumps Thunar by - maybe - ten times? By the way, it's made by the same already mentioned IgnorantGuru. And no - you can't remove Thunar, it's like Internet Explorer of Windows to Xfce, very integrated, yes, sir.
- What aliases we have preinstalled? Type 'al' in terminal and you'll see.
- How to make your terminal more colorful? See here.
- A BUG, or something: new Xfce Panel whines sillily every time you login: delete .cache/sessions, logout without 'save session' checked, login and no more whining.
- Iceweasel, the bastard Firefox, didn't have 'add new tab ' after tab... you can add general one from 'cutomizing' menu. Bookmarks Toolbar didn't work... | Edit: as of 20.03.12 upgrade, both issues seemed fixed... then after some days, Bookmarks Toolbar failed again. So I 'removed' Iceweasel and installed Firefox. And strange is - evil Firefox has no problems with working. Iceweasel problems, of course, are not Vsido problems.) Edit |

... I like Vsido. It's definitely a place for finding new exciting things - like there IS thing called 'virtual terminal' and such... :)
If you are an outgrown n00b craving new challenges - after Ubuntuland, Vsido is more than interesting, but not overly complicated place to proceed ones' education in.  
Recommended!