>Suspend-Shutdown-Reboot-Hibernate-Logout openbox

>this script to be added on fbpanel

separator {
        }
        item {
icon = lock
name = Lock screen
action = xscreensaver-command -lock
}

        item {
icon = gnome-log-out
name = Logout
action = openbox –exit
}
item {
icon = sleep
name = Suspend
action = dbus-send –system –print-reply –dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Suspend
}
item {
icon = sleep
name = Hibernate
action = dbus-send –system –print-reply –dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Hibernate
}
item {
icon = reload
name = Reboot
action = dbus-send –system –print-reply –dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart
}
item {
icon = system-shutdown
name = Shutdown
action = dbus-send –system –print-reply –dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop
}

Posted in Uncategorized | Leave a comment

>WICD bug

>https://bugzilla.redhat.com/show_bug.cgi?id=645251

/usr/lib/python2.7/site-packages/wicd/configmanager.py
 
""" configmanager -- Wicd configuration file manager

Wrapper around ConfigParser for wicd, though it should be
reusable for other purposes as well.

"""

#
# Copyright (C) 2008-2009 Adam Blackburn
# Copyright (C) 2008-2009 Dan O'Reilly
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License Version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
#

import os, copy
import cPickle

from ConfigParser import RawConfigParser

from wicd.misc import Noneify, to_unicode

from dbus import Int32

class ConfigManager(RawConfigParser):
""" A class that can be used to manage a given configuration file. """
def __init__(self, path, debug=False, mark_whitespace="`'`"):
RawConfigParser.__init__(self, allow_no_value=True)
self.config_file = path
self.debug = debug
self.mrk_ws = mark_whitespace

def __repr__(self):
return self.config_file

def __str__(self):
return self.config_file

def get_config(self):
""" Returns the path to the loaded config file. """
return self.config_file

def set_option(self, section, option, value, write=False):
""" Wrapper around ConfigParser.set

Adds the option to write the config file change right away.
Also forces all the values being written to type str, and
adds the section the option should be written to if it
doesn't exist already.

"""
if not self.has_section(section):
self.add_section(section)
if isinstance(value, basestring):
value = to_unicode(value)
if value.startswith(' ') or value.endswith(' '):
value = "%(ws)s%(value)s%(ws)s" % {"value" : value,
"ws" : self.mrk_ws}
RawConfigParser.set(self, section, str(option), "None" if value is None else value)
if write:
self.write()

def set(self, *args, **kargs):
""" Calls the set_option method. """
self.set_option(*args, **kargs)

def get_option(self, section, option, default="__None__"):
""" Wrapper around ConfigParser.get.

Automatically adds any missing sections, adds the ability
to write a default value, and if one is provided prints if
the default or a previously saved value is returned.

"""
if not self.has_section(section):
if default != "__None__":
self.add_section(section)
else:
return None

if self.has_option(section, option):
ret = RawConfigParser.get(self, section, option)
if (isinstance(ret, basestring) and ret.startswith(self.mrk_ws)
and ret.endswith(self.mrk_ws)):
ret = ret[3:-3]
if default:
if self.debug:
print ''.join(['found ', option, ' in configuration ',
str(ret)])
else:
if default != "__None__":
print 'did not find %s in configuration, setting default %s' % (option, str(default))
self.set(section, option, str(default), write=True)
ret = default
else:
ret = None

# Try to intelligently handle the type of the return value.
try:
if not ret.startswith('0') or len(ret) == 1:
ret = int(ret)
except (ValueError, TypeError, AttributeError):
ret = Noneify(ret)
# This is a workaround for a python-dbus issue on 64-bit systems.
if isinstance(ret, (int, long)):
try:
Int32(ret)
except OverflowError:
ret = str(ret)
return to_unicode(ret)

def get(self, *args, **kargs):
""" Calls the get_option method """
return self.get_option(*args, **kargs)

def _write_one(self):
""" Writes the loaded config file to disk. """
for section in self.sections():
if not section:
self.remove_section(section)
configfile = open(self.config_file, 'w')
RawConfigParser.write(self, configfile)
configfile.close()

def remove_section(self, section):
""" Wrapper around the ConfigParser.remove_section() method.

This method only calls the ConfigParser.remove_section() method
if the section actually exists.

"""
if self.has_section(section):
RawConfigParser.remove_section(self, section)

def reload(self):
""" Re-reads the config file, in case it was edited out-of-band. """
self.read(self.config_file)

def read(self, path):
""" Reads the config file specified by 'path' then reads all the
files in the directory obtained by adding '.d' to 'path'. The files
in the '.d' directory are read in normal sorted order and section
entries in these files override entries in the main file.
"""
RawConfigParser.read(self, path)

path_d = path + ".d"
files = []

if os.path.exists(path_d):
files = [ os.path.join(path_d, f) for f in os.listdir(path_d) ]
files.sort()

for fname in files:
p = RawConfigParser()
p.read(fname)
for section_name in p.sections():
# New files override old, so remove first to avoid DuplicateSectionError.
self.remove_section(section_name)
self.add_section(section_name)
for (name, value) in p.items(section_name):
self.set(section_name, name, value)
# Store the filename this section was read from.
self.set(section_name, '_filename_', fname)


def _copy_section(self, name):
p = cPickle.loads(cPickle.dumps(self, -1))
for sname in p.sections():
if sname != name:
p.remove_section(sname)
p.config_file = p.get_option(name, '_filename_', p.config_file)
p.remove_option(name, '_filename_')
return p

def write(self):
""" Writes the loaded config file to disk. """
p = cPickle.loads(cPickle.dumps(self, -1))
for sname in p.sections():
fname = p.get_option(sname, '_filename_')
if fname and fname != self.config_file:
section = self._copy_section(sname)
p.remove_section(sname)
section._write_one()

for sname in p.sections():
p.remove_option(sname, '_filename_')
p._write_one()

 
Posted in Uncategorized | Leave a comment

>Transparent Terminal Openbox

>source : http://bleedux.wordpress.com/2010/11/02/transparent-terminal-in-openbox-background/

using gnome-terminal, xcompmgr
sudo apt-get install gnome-terminal xcompmgr

and then add this on ~/.config/openbox/autostart.sh
xcompmgr -I1 -O1 -Ff &
(sleep 5s && gnome-terminal –geometry=40×15+0+540) &
this will make terminal show on bottom left… 1280×800 pixels…
use gnome-terminal –help for addition info

after that
copy – paste this to
~/.config/openbox/rc.xml

<application name="urxvt">
  <decor>no<!--decor>
  <focus>yes<!--focus>
  <position>
    <x>center<!--x>
    <y>200<!--y>
  <!--position>
  <layer>below<!--layer>
  <desktop>all<!--desktop>
  <!--  true #Only if you want a full size terminal.-->
  <skip_taskbar>yes<!--skip_taskbar>
 <!--application>
Posted in Uncategorized | Leave a comment

>MOC

>

Install MOC
$ sudo apt-get install moc
Menjalankan MOC
$ mocp
Melihat help/tombol control moc : ?
Tombol control moc :
enter — starts playing
s — stops playing
n — plays next item from the playlist
b — plays previous item from the playlist
space — pause
p — pause
S — plays at random
R — repeats the same song in a loop,
Next (X button below) must be OFF
X — switches to play sequentially
o — plays a file from the Internet
u — moves playlist item up
j — moves playlist item down
Ctrl+u — adds the URL to the playlist
g — searches marked string in file names
/ — searches marked string in file names
r — rereads the directory
T — switches to the theme selection menu
f — toggles display mode of song titles
TAB — switches marker bar between the playlist
and the file manager panels
l — switches between displaying the playlist
or the file manager panel
P — switches full path in the playlist
H — toggles hidden files view
Ctrl-t — toggles song duration time
Ctrl-f — toggles format file view
m — moves to directory entered in config file
G — moves to directory with currently played file
i — moves to marked directory
U — moves to upper directory
a — adds a file to the playlist
A — adds a directory recursively to the playlist
C — clears the playlist
V — saves the playlist
d — removes marked item from the playlist
Y — removes all empty items from the playlist
< — decreases volume by 1% , — decreases volume by 5% > — increases volume by 1%
. — increases volume by 5%
x — toggles the mixer channel
? — shows help
! — goes to a fast dir 1 (set in config file)
@ — goes to a fast dir 2
# — goes to a fast dir 3
$ — goes to a fast dir 4
% — goes to a fast dir 5
^ — goes to a fast dir 6
& — goes to a fast dir 7
* — goes to a fast dir 8
( — goes to a fast dir 9
) — goes to a fast dir 10
F1 — executes ExecCommand1 (set in config file)
F2 — executes ExecCommand2
F3 — executes ExecCommand3
F4 — executes ExecCommand4
F5 — executes ExecCommand5
F6 — executes ExecCommand6
F7 — executes ExecCommand7
F8 — executes ExecCommand8
F9 — executes ExecCommand9
F10 — executes ExecCommand10
Posted in Uncategorized | Leave a comment

>Finch

>Simple tutorial

Synopsis

finch [options]

Description

finch is a console-based modular messaging client based on libpurple which is capable of connecting to AIM, MSN, Yahoo!, XMPP, ICQ, IRC, SILC, Novell GroupWise, Lotus Sametime, Zephyr, Gadu-Gadu, and QQ all at once. It has many common features found in other clients, as well as many unique features. Finch is not endorsed by or affiliated with America Online, ICQ, Microsoft, or Yahoo.

Options

The following options are provided by finch using the standard GNU command line syntax:

-d, –debug
Print debugging messages to stderr and start with the Debug window. The messages shown in the Debug window are the same as the ones printed in stderr.
-c, –config=DIR
Use DIR as the directory for config files instead of ~/.purple.
-h, –help
Print this help and exit.
-n, –nologin
Don’t automatically login when finch starts. Sets all accounts to Offline.
-v, –version
Display the version information window.

GNT Shortcuts

You can use the following shortcuts:

Alt + a
Bring up a list of available actions. You can use this list to access the accounts window, plugins window, preference window etc.
Alt + n
Go to the next window.
Alt + p
Go to the previous window.
Alt + w
Show the list of windows. You can select and jump to any window from the list.
Alt + c
Close the current window.
Alt + q
Quit.
Alt + m
Start moving a window. Press the cursor keys to move the window. When you are done, press Enter or Escape.
Alt + r
Start resizing a window. Press the cursor keys to resize the window. When you are done, press Enter or Escape.
Alt + d
Dump the contents of the screen in HTML format in a file named “dump.html” in working directory.
Alt + .
Move the position of the current window in the window list one place to the right.
Alt + ,
Move the position of the current window in the window list one place to the left.
Alt + l
Refresh the windows. This is useful after resizing the terminal window.
Alt + 1 2 … 0
Jump to the 1st, 2nd … 10th window.
Ctrl + o
Bring up the menu (if there is one) for a window. Note that currently only the buddylist has a menu.

Files

~/.gntrc: configuration file for gnt applications.

A sample file looks like:
[general]shadow = 0# There is experimental mouse supportmouse = 1# To use some custom window-managerwm = /usr/local/lib/purple/s.so# Remember window-positions based on the titles (on by default)remember_position = 1[colors]# The RGB values range in [0, 1000]black = 0; 0; 0red = 1000; 0; 0green = 0; 1000; 0blue = 250; 250; 700white = 1000; 1000; 1000gray = 700; 700; 700darkgray = 256; 256; 256[colorpairs]normal = white; blackhighlight = white; bluehighlightd = black; grayshadow = black; darkgraytitle = white; bluetitled = white; graytext = white; bluedisabled = gray; blackurgent = green; black# Remap some keys for GntEntry[GntEntry::remap]# Remap the up-arrow to the left-arrow^[[A = ^[[D# Remap the down-arrow to the right-arrow^[[B = ^[[C# Remap ‘a’ to ‘bcd’a = bcd# Completely ignore the key ‘q’q =# But the following will NOT work#abc = bcd# Hitting ‘space’ will activate a button[GntButton::remap] = r

Widget Actions

You can specifiy key-bindings for specific widgets. The following entries in ~/.gntrc correspond to the default keybindings for the actions:[GntEntry::binding]
c-a = cursor-home
home = cursor-home
c-e = cursor-end
end = cursor-end
backspace = delete-prev
del = delete-next
c-d = delete-next
c-u = delete-start
c-k = delete-end
c-b = cursor-prev
left = cursor-prev
c-f = cursor-next
right = cursor-next
tab = suggest-show
down = suggest-next
up = suggest-prev
c-w = delete-prev-word
a-b = cursor-prev-word
a-f = cursor-next-word
a-d = delete-next-word
c-v = clipboard-paste
[GntTree::binding]
up = move-up
down = move-down
c-n = move-down
c-p = move-up
pageup = page-up
pagedown = page-down
# Following is the default binding for the context-menu
menu = context-menu
# The following will let you open the context-menu in the buddylist with c-b
# c-b = context-menu
[GntWidget::binding]
f11 = context-menu
[GntWindow::binding]
c-o = show-menu
f10 = show-menu
The c- corresponds to the Control key. You can also use ctrl- or ctr- or ctl- to indicate a combination. For alt-keys, you can use one of a-alt-m- or meta-. You can also usehomeendleftright etc. keys.

Mouse Support

There is experimental mouse support. You can focus windows, activate buttons, select rows in a list, scroll using the wheel-scroll etc. Selecting text in a text-view copies it to the gnt clipboard. Mouse support is disabled by default, so you need to enable it in ~/.gntrc (see the sample above).

Window Management

The default window management is very limited. But it is possible to write custom window managers to suit your needs. There is a sample window-manager included (nameds.so) which adds a little ‘close-button’ for the windows, removes the borders from the buddylist and pops up new windows in the middle of the screen, instead of at the upper-left corder. It is provided as a sample simple manager, but it should be possible to write more complex managers, and it’s very possible that the window-manager API will need to be enhanced. Look at the sample ~/.gntrc file ab
ove to see how to select a window-manager.It is also possible to rebind the window-manager actions in ~/.gntrc, eg:
[GntWM::binding]
a-n = window-next
a-p = window-prev
a-c = window-close
a-w = window-list
a-d = dump-screen
a-, = shift-left
a-. = shift-right
a-a = action-list
a-m = start-move
a-r = start-resize
a-q = wm-quit
a-l = refresh-screen
# The following action is still incomplete, and doesn’t have a default binding
# switch-window-n
# For the sample custom window manager
[GntS::binding]
a-b = toggle-buddylist
a-C = toggle-clipboard

Conversation Commands

There are a few helpful commands in addition to the regular commands. You can use these from any conversation to access other windows.

accounts
for the accounts window.
buddylist
for the buddylist.
debugwin
for the debug window.
plugins
for the plugins window.
prefs
for the preferences window.
status
for the status window.
source : 

http://linux.die.net/man/1/finch

Posted in Uncategorized | Leave a comment

>FBpanel

>source : http://crunchbanglinux.org/forums/topic/9770/fbpanel-no-need-for-conky-long-read/

Since Fbpanel is well documented http://fbpanel.sourceforge.net/docs.html, I’m just going right to the customization part:
The linux menu (applications, end session, etc):
Plugin {
type = menu
config {
#Icon for the menu:
image = /home/slug45/.config/fbpanel/icons/start-here.svg
systemmenu {
}
separator {
}
item {
name = Reboot
icon =
action = slug_reboot
}
item {
name = Shutdown
icon =
action = slug_shutdown
}
}
}
slug_reboot is a silly script to reboot the computer using HAL, so no sessions needed:
dbus-send --system --print-reply 
--dest="org.freedesktop.Hal"
/org/freedesktop/Hal/devices/computer
org.freedesktop.Hal.Device.SystemPowerManagement.Reboot
You just need to create/copy it to /usr/bin and give it run permission (chmod +x _FILE_) as root.
For shutting down the computer:
(dbus-send --system --print-reply 
--dest="org.freedesktop.Hal"
/org/freedesktop/Hal/devices/computer
org.freedesktop.Hal.Device.SystemPowerManagement.Shutdown)
You can use 
gdm-control --shutdown && openbox --exit
and
gdm-control --reboot && openbox --exit
instead but you have to run a session for that (I don’t). So hal was the way I found for rebooting/shutting down the computer.
The launcher is just:
Plugin {
type = launchbar
config {
button {
icon = NAME_OF_THE_ICON
tooltip = THE_TOOLTIP_YOU_WANNA_USE_FOR_MOUSE_OVER
action = NAME_ROUTE_OF_THE_PROGRAM_OR_COMMAND_LINE
}
button {
icon = NAME_OF_OTHER_ICON
tooltip = THE_TOOLTIP_YOU_WANNA_USE_FOR_MOUSE_OVER
action = NAME_ROUTE_OF_OTHER_PROGRAM_OR_OTHER_COMMAND_LINE
}

...you keep copy/pasting this for each application and don't forget to add:

}
This is how you get a space between icons:
Plugin {
type = space
config {
size = 13
}
}
The taskbar with only icons, no captions:
Plugin {
type = taskbar
expand = true
config {
ShowIconified = true
ShowMapped = true
ShowAllDesks = true
tooltips = true
IconsOnly = true
MaxTaskWidth = 20
}
}
The System tray:
Plugin {
type = tray
}
The system- updater icon:
Plugin {
type = launchbar
config {
button {
image = /home/slug45/.config/fbpanel/icons/system-upgrade.png
tooltip = update-manager
action = update-manager
}
}
}
This checks fo
r updates and shows the number of available updates to the right of the system-updater icon:
Plugin {
type = genmon
config {
Command = echo $(aptitude search "~U " | wc -l | tail)
PollingTime = 2
TextSize = large
TextColor = #dd8436
}
}
The Gmail icon:
Plugin {
type = launchbar
config {
button {
image = /home/slug45/.config/fbpanel/icons/gmail.png
tooltip = firefox http://mail.google.com
action = firefox http://mail.google.com
}
}
}
If you click it, it will open firefox with mail.google.com (that’s all).
This will run a script to check for mails at gmail and show if you got new mails or not:
Plugin {
type = genmon
config {
Command = echo $(slug_gmail | grep 'mail' | cut -c8-8)
PollingTime = 2
TextSize = large
TextColor = #dd8436
}
The script it calls to is:
#!/bin/bash

atomlines=`wget -T 3 -t 1 -q --secure-protocol=TLSv1
--no-check-certificate
--user=GMAIL_USERNAME --password=GMAIL_PASSWORD
https://mail.google.com/mail/feed/atom -O -
| wc -l`

echo -e "rc"

[ $atomlines -gt "8" ]
&& echo -e " mail Y c"
|| echo -e " mail - c"
Just change GMAIL_USERNAME and GMAIL_PASSWORD and again, save it to /usr/bin and give it run permission, as root. You can use whatever script/application you want, this just works to me. If you got mail, it will show a “Y” to the right of the gmail icon or a “-” if you don’t have new mail.
This is for the cpu temperature, core 1 (You might need to tweak this.):
Plugin {
type = genmon
config {
Command = echo " "$(sensors | grep 'temp1' | cut -c15-16)"º"
PollingTime = 2
TextSize = small
TextColor = #c8c8c8
}
}
Core 2:
Plugin {
type = genmon
config {
Command = echo $(sensors | grep 'temp3' | cut -c15-16)"º"
PollingTime = 2
TextSize = small
TextColor = #c8c8c8
}
}
The cpu graph:
Plugin {
type = cpu
config {
Color = #c8c8c8
}
}
The mem graph:
Plugin {
type = mem
config {
ShowSwap = false
}
}
The network graph:
Plugin {
type = net
config {
interface = eth0
TxLimit = 600
RxLimit = 1200
TxColor = red
RxColor = #dd8436
}
}
This will show the % of volume of the soundcard, you need to tweak this depending in your hardware or just don’t use it and use another software like volwheel, etc.
Plugin {
type = genmon
config {
Command = echo $(amixer --card 1 sget 'PCM' | grep "Front Left:" | sed "s/^.*[([0-9]*)"%"].*/1/")"%"
PollingTime = 2
TextSize = medium
TextColor = #dd8436
}
}

This will show if the sound card is muted or not [on] = unmuted; [off] = muted:
Plugin {
type = genmon
config {
Command = echo $(amixer --card 1 sget 'PCM' | grep "Front Left:" | sed "s/.* //")
PollingTime = 2
TextSize = large
TextColor = #c8c8c8
}
}
This will show the up time:
Plugin {
type = genmon
config {
Command = echo " "$(uptime | grep 'up' | cut -c14-18)" /"
PollingTime = 2
TextSize = small
TextColor = #dd8436
}
}
And this is for the clock:
Plugin {
type = dclock
config {
ShowSeconds = false
HoursView = 24
Action =
color = #c8c8c8
}
}
Little bonus. This will show the kernel version:
Plugin {
type = genmon
config {
Command = echo " "$(uname -r)"-"
PollingTime = 2
TextSize = small
TextColor = #c8c8c8
}
}
You might need to tweak some of the sections depending on your hardware (like the temps and the volume parts), but the rest should work.
I hope you like it and let me know if you got more ideas!.
PD: Needed dependencies:
Hal
sudo apt-get install hal
Sound
sudo apt-get install alsa-base
Update Manager
sudo apt-get install update-manager
CPU Sensors
sudo apt-get install lm-sensors
Run 
 sudo sensors-detect
and answer Y to all to install it.
Posted in Uncategorized | Leave a comment

>Change Cursor Openbox

>

just add
export XCURSOR_THEME="name-of-cursor-theme"
to your ~/.config/openbox/autostart.sh
Posted in Uncategorized | Leave a comment

>Right / Left Handed mouse????

>Rıght handed: (F1)
xmodmap -e ‘pointer = 1 2 3’ & synclient TapButton1=1 & synclient RBCornerButton=3 & gconftool -s /desktop/gnome/peripherals/mouse/cursor_theme -t string ComixCursors-Black-Regular

Left handed: (F2)
xmodmap -e ‘pointer = 3 2 1’ & synclient TapButton1=3 & synclient RBCornerButton=1 & gconftool -s /desktop/gnome/peripherals/mouse/cursor_theme -t string ComixCursors-LH-Black-Regular 

Posted in Uncategorized | Leave a comment

>Blokir facebook dengan squid

>#vim /etc/squid/bloksitus.txt
kemudian masukan situs2 yg akan kita blokir… umpamanya masukan
.facebook.com
diawali dengan tanda titik karena kita juga akan memblok seluruh sub domainnya.
setelah itu buka file konfigurasi squid yg berada di /etc/squid/squid.conf
dan masukan script dibawah ini

acl blokir url_regex “/etc/squid/bloksitus.txt”
deny_info http://google.co.id/ blokir
acl waktu time MTWTFS 19:00-24:00
http_access allow blokir waktu
http_access deny blokir

ket: “deny_info http://google.co.id/ blokir” maksudnya saat kita mengakses situs yg berada dalam file yg dibuat tadi makan otomatis akan teredirect ke google. 


source : http://www.facebook.com/topic.php?uid=294899761915&topic=12483

Posted in Uncategorized | Leave a comment

>MPD + pulse audio

>gksudo geany /etc/default/pulseaudio
truz yg valuenya 0 jadi 1, yg 1 jadi 0

sudo apt-get install paprefs
di tab networkserver centang enable network access to local sound devices sama don’t require authentication

alt+f2
gstreamer-properties
plugin pulseaudio
devicenya default aj

Posted in Uncategorized | Leave a comment