Thursday, March 7, 2013

Watt OS OpenBox customization


Instalacija / Installing 

> sudo apt-get install openbox obconf obmenu tint2 nitrogen conky guake



openbox - interfejs / interface
obconf - konfigurator za openbox / configuration
obmenu - konfigurator za glavni meni / main menu configuration
tint2 - panel
nitrogen - podesavanje pozadine / setting wallpaper
conky - info panel
guake - padajuci terminal emulator / drop down terminal

Autostart programi / programs:

u/in "/home/username/.config/openbox" napraviti/make "autostart.sh":

nano /home/username/.config/openbox/autostart.sh

Ovde se ubacuju programi komande koje hocete da se pokrecu pri ukljucivanju openbox interfejsa.
In here, you place programs and commands that you want to autostart with openbox interface.

Ovako izgleda moj autostart.sh:
###########
tint2 & #panel

nitrogen --set-scaled /home/username/Pictures/wallpaper.jpg & #Sliku wallpaper.jpg postavljao kao pozadinu. / Sets wallpaper.jpg as background.

conky & #ukljucuje info panel koji se na slici nalazi na levoj strani. / Starts info panel which is, in this case, placed on left side.
###########

U slucaju da openbox nije dosao uz sistem, on nece sam pokrecati menadzer za mreze, u tom slucaju treba instalirati nm-applet ili wcid menadzer za mreze i dodati ga u autostart.sh. Ikonica ce se pojaviti u desnom uglu tint2 panela, to treba biti znak da mreza funkcionise. U ovom slucaju je "nm-applet" koji po defaultu dolazi uz "GNOME" interface. 
/
In case that openbox didn't came as default with system, it won't start network manager, in that case you should install "nm-applet" or "wcid" network manager and add it to autostart.sh. Network managers icon, in case it works, will appeare on the left side of tint2 panel, that should be you indicator that network is functional. In this case it's "nm-applet" which, by default comes with "GNOME" interface.

Conky je panel koji vam prikazuje stanje raznih elemenata sistema i informacije o hardveru (procentualno koriscenje jezgara procesora, temperatura istog, brzina hard diska itd).
/
Conky is panel which shows states of various elements of your system and informations about hardware (CPU usage percentage, cpu temperature, hard disk rotation speed etc.).

Conky je bez doradjene skripte u osnovi veoma ruzan i ne prikazuje mnogo informacija o celom sistemu.
/
Conky is without custom script very ugly and doesn't show much info about whole system.

Isto kao i autostart.sh, skripta za Conky se kreira i menja rucno.
Just as autostart.sh, Conky configuration script is created manualy.

Kreiranje skripte / Creating script:

"nano /home/username/.conkyrc "(conky skripta ne treba da ima ekstenziju .sh / conky script doesn't require .sh extention):

Skripta za conky koji se vidi na slici izgleda ovako / Script for conky that can be seen on pictures looks like this:

##########################################################
# UBUNTU-CONKY# A comprehensive conky script, configured for use on# Ubuntu / Debian Gnome, without the need for any external scripts.## Based on conky-jc and the default .conkyrc.# INCLUDES:# - tail of /var/log/messages # - netstat connections to your computer## -- Pengo (conky@pengo.us)#



# Create own window instead of using desktop (required in nautilus)own_window yesown_window_hints undecorated,below,skip_taskbarbackground no



# Use double buffering (reduces flicker, may not work for everyone)double_buffer yes



# fiddle with windowuse_spacer yesuse_xft yes



# Update interval in secondsupdate_interval 3.0



# Minimum size of text areaminimum_size 400 5



# Draw shades?draw_shades yes



# Text stuffdraw_outline no # amplifies text if yesdraw_borders no



uppercase no # set to yes if you want all text to be in uppercase



# Stippled borders?stippled_borders 8



# border marginsborder_margin 4



# border widthborder_width 1



# Default colors and also border colors, grey90 == #e5e5e5default_color whitedefault_shade_color blackdefault_outline_color white



own_window_colour brownown_window_transparent yes



# Text alignment, other possible values are commentedalignment top_left#alignment top_right#alignment bottom_left#alignment bottom_right



# Gap between borders of screen and textgap_x 10gap_y 10



# stuff after 'TEXT' will be formatted on screen



override_utf8_locale noxftfont Terminus:size=8xftalpha 0.8



TEXT



${offset }${color slate grey}${time %a, } ${color }${time %e %B %G}${offset 2}${color slate grey}${time %Z,    }${color }${time %H:%M:%S}${offset 2}${color slate grey}UpTime: ${color }$uptime${offset 2}${color slate grey}Kern:${color }$kernel${offset 2}${color slate grey}CPU:${color } $cpu% ${acpitemp}C${offset 2}${cpugraph 20,130 000000 ffffff}${offset 2}${color slate grey}Load: ${color }$loadavg${offset 2}${color slate grey}Processes: ${color }$processes  ${offset 2}${color slate grey}Running:   ${color }$running_processes



${offset 2}${color slate grey}Highest CPU:${offset 2}${color #ddaa00} ${top name 1}${top_mem cpu 1}${offset 2}${color lightgrey} ${top name 2}${top cpu 2}${offset 2}${color lightgrey} ${top name 3}${top cpu 3}${offset 2}${color lightgrey} ${top name 4}${top cpu 4}



${offset 2}${color slate grey}Highest MEM:${offset 2}${color #ddaa00} ${top_mem name 1}${top_mem mem 1}${offset 2}${color lightgrey} ${top_mem name 2}${top_mem mem 2}${offset 2}${color lightgrey} ${top_mem name 3}${top_mem mem 3}${offset 2}${color lightgrey} ${top_mem name 4}${top_mem mem 4}



${offset 2}${color slate grey}MEM:  ${color } $memperc% $mem/$memmax${offset 2}${membar 3,100}${offset 2}${color slate grey}SWAP: ${color }$swapperc% $swap/$swapmax${offset 2}${swapbar 3,100}



${offset 2}${color slate grey}ROOT:    ${color }${fs_free /}/${fs_size /}${offset 2}${fs_bar 3,100 /}${offset 2}${color slate grey}HOME:  ${color }${fs_free /home}/${fs_size /home}${offset 2}${fs_bar 3,100 /home}${offset 2}${color slate grey}SLACK:  ${color }${fs_free /mnt/slack}/${fs_size /mnt/slack}${offset 2}${fs_bar 3,100 /mnt/slack}${offset 2}${color slate grey}NET: ${offset 2}${color}Up: ${color }${upspeed eth0} k/s${offset 2}${upspeedgraph eth0 20,130 000000 ffffff}${offset 2}${color}Down: ${color }${downspeed eth0}k/s${color}${offset 2}${downspeedgraph eth0 20,130 000000 ffffff}

########################################################

--------------------------------
Tip:
"nano" je uredjivac tekst dokumenata i skripti koji se koristi u temrinalu, tj. tekstualnom interfejsu. Ko nije iskusan sa tekstualnim interfejsom moze goristiti graficke (leafpad, gedit...)
/
"nano" is text and script editor which is command line interface based. Those who are not experienced with command line interfaces could use those based on graphical interface (leafpad, gedit...).

Da bi se u "nano" programu sacuvao obradjeni fajl - Ctrl + o
Da bi se izaslo iz programa - Ctrl + x
/
To save edited file in "nano" - Ctrl + o
To exit "nano" - Ctrol + x
-------------------------------



Drugi programi koji su koriscenju u ovom tutorialu su "scrot" za slikanje radne povrsine, koji je takodje baziran na tekstualnom interfejsu, i "guake" padajuci emulator terminala za Linux i slicne operativne sisteme.
/
Other programs used in this tutorial are "scrot" for taking screenshots, which is also based on command line interface, and guake which is drop down terminal emulator for Linux and similar operating systems.

Wednesday, May 16, 2012

My own Linux distro project Xw0rX 0.1

Big geek wonabe is in myself. I figure that out long time ago trying to make my room a freaking sort of Watch Tower like I assume League of Justice have. I guess knowing what League of Justice is qualifies me as a geek already. But all that away, the reason I'm saying that I'm a geek wonabe, or already am is now I'm planing to make my own Linux Distribution. Well thats big bite for me of course. Of course I'm not gona do it. I just saw somewhere a tools for making your own distro with apps you want. And there it is, I want my distro to be on my flash drive with all my apps witch I need. So you kinda see it now, its actually intro for my app list :))

First, lets start with distro that I'm going to use. Since I'm not gona need Out-of-the-box distro I'm not going to use Linux Mint or similar systems witch have "everything".
I'm gona need a lightweight distro at least based on Debian, and I hope I'm going to have a chance to make one based on Ubuntu of course, cause with those apt-get or aptitude install manager is included and thats the one I got used to. So Ubuntu is the one.

Now the interface. I know that CLI would be the easies way to use all what I need, but I figure it out, for my tasks, I can't survive without GUI. So just CLI won't do it for me.
So about that GUI, I'm still gona need a lightweight one. That kicks out KDE right away from the list, leaves environments that I know to work with like Gnome derivatives, XFACE, LXDE, those *Box environments, and least wanted witch I still have no experience with, like Enlightenment and most interesting to me the tiling window managers like Awesome, Xmonad and many others.
This kinda leaves me in big dilemma, I actually have no idea witch environment to use for my distro. I'm thinking over Gnome, OpenBox and Awesome. I know everything with Gnome 2.x, I can configure almost everything on OpenBox, and have so little experience with Awesome, but going from Awesome to Gnome the performance requirements are rising, not that it matters a lot but, who knows on witch computers I'm gona use my distro. So I'll stay open minded here for now.

So lets start with app list and what every app is for:

sudo - gives me administrative privileges
apt-get - Software install manager
Thunar - File Manager (Browser)
x-terminal-emulator - name seas it all
dvtm - CLI terminal spliting
nano - CLI text editor
leafpad - GUI text editor
gmrun or dmenu - run dialog
geany - programing GUI
epic5 - CLI IRC client
mplayer - media player
audacious - audio player
ffmpeg - enables playing, converting and scripting media files
sox - CLI tool for creating spectrograms from wav files
bluetooth-agent - bluetooth
hcitool - bluethoot tool (for making bluetooth scripts)
grep - mostly for piping text of other tools
dbview - DBF viewer
nmap - universal network tool
aircrack-ng - network hacking set of tools
wireshark - network monitoring tool
bmon - CLI network monitoring tool
clamAV - free antivirus (in case I might need it somewhere)
postler or geary - Email client
firefox - web browser
'tor' or similar - private web browsing
ssh - secure shell
Wicd - Network manager (I might prefer Gnome Network Manager in Gnome)
Calculator - do you really need an explanation :)
file-roller (rar, 7zip, gz...) - compress/uncompress files
gThumb - Image viewer/editor
evince - Document viewer (PDF)
simplescan - Scanning app
transmission - torrent client
rtorrent - cli torrent client
pidgin - multi-platform instant messenger
gparted  - partitioning tool
giver - sharing tool for network between linux systems only
samba4 - sharing tool for windows network
abiword - Text processing tool (like MS Word)
conky - customizable system info tool

Not sure that all this apps are compatible with OpenBox, especially with Awesome, so Gnome would be the one but it might not be the most lightweight, so OpenBox is probably the best solution. So there are few apps for OpenBox that would make it easier to use and customize:

obmenu - menu editing tool
obconf - configuring tool for openbox
openbox-themes - no need to translate :)
nitrogen - wallpaper manager
tint2 - panel

Even if openbox is lightweight and fast, it takes a lot of time to be configured and customized for final release of my distro so that it could be fully usable. But since I'm planing this distro only for personal tasks, I shouldn't care about user friendly environment cause for me, OpenBox is userfriendlly enough.

Now to have some kickoff for this project of mine:

http://maketecheasier.com/build-your-own-ubuntu-based-distro-with-novo-builder/2010/07/02

http://www.tuxradar.com/content/build-your-own-linux-distribution-easy-way

Since I'm looking up to Crunchbang as distro that mine is going to be closest to by functionality and looks, I'm probably going to need this post to get along.

http://crunchbanglinux.org/wiki/adding_crunchbang_features_in_another_distro

From this, you (who every is reading this blog, if any) see that I'm not planing to do all this from LFS (linux from scratch) but with simple GUI that would make all this easy and possible without much of coding from my side. Witch is rational thinking cause my programing skills ain't on some proud level.

So here are some new links that could help me with making my project realization so much easier.



Tutorial here:
http://www.ubuntugeek.com/creating-custom-ubuntu-live-cd-with-remastersys.html
http://klikit.pbworks.com/Remastersys+tutorial+by+dedoimedo
Downloadable here:
http://remastersys.sourceforge.net/remastersystool.html

Since I'm going to need some security/testing/penetrating tools, this commands would remind me of programs I'll need here and there:
http://www.cyberciti.biz/tips/linux-iptables-examples.html

As I'm getting better and better with xterm (or Linux terminal) I'm thinking more about using a tiling window manager for my distro... Awesome and Xmonad are best known as tiling WMs. So if I get more familiar with Xmonad till I start building my distro, here is a link from HGT for using it:
http://www.howtogeek.com/114728/how-to-use-xmonad-a-tiling-window-manager-for-linux/
Find this two:
http://www.haskell.org/haskellwiki/Xmonad/Using_xmonad_in_Gnome

So I actually learned enough about XMonad to start using it.
So here are apps for it that I'd need for starters so I could use it properly:
nm-applet - a panel network manager applet
trayer - panel for xmonad
terminator - I think its best terminal emulator for xmonad by my opinion


I've installed crunchbang on my laptop and xmonad within.
I'm working 95% efficiently with that combination so that could be my final solution for distro+wm.
I'm going to remove all other wms cause with crunchbang  KDE and Gnome are included so there would be options of combining them with openbox, witch sucks for me to be honest and is totally redundant.
For now on, I'm going to be on standby, cause there is a lot of work around, so working on my distro is now secondary task.
I'll work with this crunchbang on my laptop, make it stable and when I'm 100% sure that it works perfectly for me with xmonad, I'll creat distro of it.



Ok so here is crunchbang with xmonad working, with xmobar, terminals, and nitrogen which controls that background, I still don't know how to setup startup applications but all in time...



Now, after enough experience with this XMonad, I realized it can't work on every platform the right way, so that means getting back to some "normal" window manager, that actually for me means that *box window managers are also not going to be included in my wish list right now.


I'm thinking now about Gnome, XFCE or LXDE. Since all those can be find in most Ubuntu distributions, first thought was Lubuntu or Xbuntu.
Lubuntu 10.04.4 would be the great choice now, it's light, uses kernel version 2.*, so its lightweight and user friends at the same time as much as possible.
But before getting it to USB, it would be a good idea to  update it and then disable the updates. So now, here we go with Lubuntu 10.04.4

So here is what I run the first time after installing lubuntu on my laptop:


############################
sudo apt-get update && sudo apt-get upgrade
############################

then after that being done i removed programs I don't need:

#######################################
sudo apt-get remove mtpaint sylpheed osmo aqualung gnome-mplayer
##########################################
which will remove 14 MB, not much but I like to keep things clean.
that being said:

###############################
sudo apt-get autoremove && sudo apt-get autoclean
###############################

Now lets go back to list of programs I do need and install them:

############
sudo apt-get install geany epic5 mplayer audacious ffmpeg grep dbview nmap aircrack-ng wireshark bmon clamav openssh-client openssh-server gthumb rtorrent gparted giver samba4 conky
############

I've skiped few from my list cause there are already similar or better options involved, or simply I realized I don't need them that much.

Ok. So here is the next problem. Lubuntu is quite different from Ubuntu in some parts of functionality, so Novo-builder isn't working in it like it should, or its that the Novo-builder is working only on Ubuntu and not any other derivatives.

So here we are, again, beck to the Ubuntu.
I'm still gonna use 10.04.4 LTS version, since latter versions are quite high on system requirements, and I'm planing to make this distro lightweight one.

Since this time the subject is basic Ubuntu 10.04.4 LTS list of new apps and the ones that  should be removed would be different from the ones I used in Lubuntu.
So here it goes:

Removing:
################
sudo apt-get remove gedit tomboy aisleriot gbrainy gnome-games-common f-spot openoffice.org-* empathy gwibber evolution pitivi rhythmbox
################
I would probably also include removing Nautilus since I want Thunar to be default file manager.

Installing new:
##########
sudo apt-get install thunar thunar-archive-plugin leafpad dmenu geany epic5 mplayer ffmpeg audacious grep dbview nmap aircrack-ng wireshark bmon clamav openssh-client openssh-server rar unrar gthumb evince rtorrent pidgin gparted giver samba4 abiword conky
##########

Ok so here is how this distro looks like so far:


Looks great to be honest. By the background you already see how am I going to name my distro. Of course. As my tech channel on youtube XW0RKS with some additional markings like OS, Linux, x86 or something similar.

So here is how it looks now... Geek factor 95%


Tron theme and some Drakefire Icon theme made it more hollywood, which works for me.

So now I'm ready to make this thing bit more lighther and then try to put it all in single .iso file.

Well so much about lightweights. Distro weights more then one GB. Couse I'm planing to place this distro on USB drive which has less then 1GB, I'll need to do a lot more to make it lighter then this.
 

I managed to shrink it to bit less then 950MB and now it can fit on my 1GB flash, but thats temporary solution for me. I'll see what I can do to shrink it even more after I make it lightweight and fast as it can get.

So now distro looks great:

 
But when I run it from flash drive it looks ugly as hell:

When .iso was created it didn't picked up xw0rks.jpg file from /usr/share/backgrounds/ so there is only this horrible color as wallpaper, and menus are placed by default, and since I deleted all the themes exept the ones I use when distro looks nice, it uses this basic theme for windows and menues.
So for now distro looks like this every time I boot it from USB, but not much is needed for me to customize it back to my planned original 'tron' theme.

Next step is to remove those things that I probably am not going to need at any time.
Samba, geany, dictionary etc.

So I did, now I'm going to chose Openbox as my final solution for lightweight window manager of my distro.

##################################
sudo apt-get install openbox obconf obmenu tint2 nitrogen
##################################

After that I logoff, login to openbox session and remove nautilus and gnome for good.

#######################
sudo apt-get remove nautilus* gnome*
#######################

This command will remove everything related both to nautilus and gnome.

That worked well, nothing but openbox left on my machine, but that comes with new problems.

Most of the things that work on Ubuntu, works over Gnome, so now network doesn't work nor the sound does, and pictures can't be viewed cause there is no software anymore for that.

In Gnome "eog" (eye of gnome) was the viewer for pictures, now it's gonne but I fix that by installing "feh" the most lightweight possible image viewer there is for linux. It's most lightweight cause it really has no interface, you actually run it from terminal, or when you double click the image it opens with only window border and no interface.

For network, I plugged in ethernet cable (cause this is laptop and I want it to have WLAN) so I could install some software.
I tried "wcid" which is network manager for most linux distros, it worked fine for wired but didn't work for wireless connection, in short, wifi doesn't work with it somehow.



I didn't want to experiment with "wcid" and try to make it work with wifi, I just removed it and install the old good "nm-applet" which works perfectly with wifi, it connected right away.

By my opinion, the most important problem to be solved wouldn't be disabled sound, but the fact that autostart script doesn't work. I put autostart file in ~/.config/openbox/autostart and this is the code for it:

####################################

#Panel
tint2 &

#Network
nm-applet &

#wallpaper
nitrogen --set-centered /home/x/Pictures/xw0rks.png

####################################

It seas it all by it self about what it does, or what it should do every time I start openbox-session, but right now for some reasons, unknown to my brain, it doesn't work.


Now, I find out whats the problem with startup programs. I found on every and each forum that autostart programs are placed in .config/openbox/autostart file, but actually its autostart.sh file, it has to be shell thing, so that solves the problem. I just rename autostart to autostart.sh and everything works just fine.

After all of that, I didn't have much will of customizing my distro, I just decided to make it the first time and publish it.

So here it is finally, Xw0rX 0.1:
https://docs.google.com/open?id=0B_yXkeb_Ey2TVUpjSnFYV2hDYzA

Right now, I'm gonna take a break from this distro and continue improving it some other time, for now. So long geeks.

================================================================================

Lets bring now some rational thinking with this.
I'm gonna make another list of programs that I need, this time, I'm gonna use as much as CLI based apps as possible instead of GUI ones.


File Manager - ranger
Web Browser - Chromium-browser
rtorrent - torrent client
x-terminal-emulator - xterm
Text editor - nano and/or leafpad
run dialog - gmrun
irc client - epic5 
media player - mplayer
music player - audacious or mp3blaster
media conversion - ffmpeg
data base viewer - dbview
ssh - openssh-client and openssh-server
network manager - wcid (would probably need to figure out how to work with it)
file compression - file-roller, rar, unrar...
image - feh
pdf - evince
hard drive partitioning - gparted
file sharing - giver, samba
total commander alternative - midnightcommander

In case I use openbox:

panel - tint2
configuring wm - obconf
configuring ob menu - obmenu
themes - openbox-themes

In case I use Gnome

remove: nautilus, evolution and more.

Here are the codes for openbox from ubuntu:

##############
sudo apt-get install openbox obmenu obconf openbox-themes tint2 ranger chromium-browser rtorrent nano leafpad gmrun epic5 mplayer audacious ffmpeg dbview openssh-client openssh-server wcid file-roller rar unrar feh evince gparted giver samba4 midnightcommander
#############

Removing:
#############
sudo apt-get remove gnome* nautilus* gedit tomboy aisleriot gbrainy gnome-games-common f-spot openoffice.org-* empathy gwibber evolution pitivi rhythmbox transmission gnome-terminal
#############