SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 Re: Tips, Tricks & Scripts » My Conky Config » 2009-02-25 09:22:10

sgk

Here is my desktop with all the goodies: Openbox, Conky, Wbar Launcher and System Tray. Enjoy smile
Pqa0J2J.jpg

Here are the config files and scripts:
Conky

# set to yes if you want Conky to be forked in the background
background yes

# Use Xft?
use_xft yes

# Xft font when Xft is enabled
xftfont DejaVu Sans:size=7

# Text alpha when using Xft
xftalpha 1

# Update interval in seconds
update_interval 1.0

# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0

own_window yes
own_window_transparent yes
#own_window_type override
own_window_type desktop
#own_window_type normal #use this if you want a nice shadow to appear around conky

# If own_window is yes, these window manager hints may be used
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

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

# Minimum size of text area
minimum_size 200 200

# Maximum width
maximum_width 240

# Draw shades?
draw_shades yes

# Draw outlines?
draw_outline no

# Draw borders around text
draw_borders no

# Draw borders around graphs
draw_graph_borders no

# Stippled borders?
# stippled_borders 8

# border margins
# border_margin 2

# border width
# border_width 1

# Default colors and also border colors
default_color white
default_shade_color black
default_outline_color white

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

# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x 12
gap_y 12

# Subtract file system buffers from used memory?
no_buffers yes

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

# number of cpu samples to average
# set to 1 to disable averaging
cpu_avg_samples 2

# Force UTF8? note that UTF8 support required XFT
##override_utf8_locale no
override_utf8_locale yes

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

TEXT
SYSTEM INFO: ${hr 2}
Host:$alignr$nodename
Uptime:$alignr$uptime
RAM:$alignr$mem/$memmax
Swap usage:$alignr$swap/$swapmax
Disk usage:$alignr${fs_used /}/${fs_size /}
Processor #1:$alignr${cpu cpu1}%
${font Webdings:size=16}~${font} Battery: ${battery_percent BAT0}% ${alignr}${battery_bar 8,60 BAT0}
NETWORK ${hr 2}
${if_existing /proc/net/route wlan0}
  Up: ${upspeed wlan0} kb/s ${alignr}${upspeedgraph wlan0 8,60 789E2D A7CC5C}
  Down: ${downspeed wlan0} kb/s ${alignr}${downspeedgraph wlan0 8,60 789E2D A7CC5C}
  Signal: ${wireless_link_qual wlan0}% ${alignr}${wireless_link_bar 8,60 wlan0}
  Local Ip: ${alignr}${addr wlan0}${else} ${if_existing /proc/net/route eth0}
   ${voffset -6}${font PizzaDude Bullets:size=14}O${font} Up: ${upspeed eth0} kb/s ${alignr}${upspeedgraph eth0 8,60 789E2D A7CC5C}
   ${voffset 4}${font PizzaDude Bullets:size=14}U${font} Down: ${downspeed eth0} kb/s ${alignr}${downspeedgraph eth0 8,60 789E2D A7CC5C}
   ${voffset 4}${font PizzaDude Bullets:size=14}a${font} Local Ip: ${alignr}${addr eth0} ${else}  ${font PizzaDude Bullets:size=14}4${font}   Network Unavailable ${endif}
${endif}
SHORTCUT KEYS: ${hr 2}
Alt+F2$alignr Run Dialog
Alt+F3$alignr Alt Menu
Super+space$alignr Main Menu
Super+tab$alignr Client Menu
Super+v$alignr Volume Control
Super+u$alignr System Update
Super+x$alignr Logout
PrtSc$alignr Screenshot
WEATHER: ${hr 2}
${if_existing /proc/net/route wlan0}
  ${voffset -8}${alignr 56}${font ConkyWeather:style=Bold:size=40}${execi 600 conkyForecast --location=GRXX0004 --datatype=WF}${font}
  ${voffset -52}${font Weather:size=40}y${font}  ${voffset -38}${font DejaVu Sans:size=26}${execi 600 conkyForecast --location=GRXX0004 --datatype=HT}${font}
  
  
  ${voffset 0}Humidity: ${alignr}${execi 600 conkyForecast --location=GRXX0004 --datatype=HM}
  ${voffset 0}Moon Phase: ${alignr}${execi 600 conkyForecast --location=GRXX0004 --datatype=MP}
  ${voffset 0}${font}Wind Speed: ${alignr}${execi 600 conkyForecast --location=GRXX0004 --datatype=WS}
${else}   ${if_existing /proc/net/route eth0}
     ${voffset -8}${alignr 56}${font ConkyWeather:style=Bold:size=40}${execi 600 conkyForecast --location=GRXX0004 --datatype=WF}${font}
     ${voffset -52}${font Weather:size=40}y${font}  ${voffset -38}${font Trebuchet MS:size=26}${execi 600 conkyForecast --location=GRXX0004 --datatype=HT}${font}
     
     
     ${voffset 0}Humidity: ${alignr}${execi 600 conkyForecast --location=GRXX0004 --datatype=HM}
     ${voffset 0}Moon Phase: ${alignr}${execi 600 conkyForecast --location=GRXX0004 --datatype=MP}
     ${voffset 0}${font}Wind Speed: ${alignr}${execi 600 conkyForecast --location=GRXX0004 --datatype=WS}
   ${else}     ${font PizzaDude Bullets:size=14}4${font}   Weather Unavailable   ${endif}
${endif}
GMAIL: ${hr 2}
You have ${color3}${texeci 60 perl ~/scripts/gmail.pl n} ${color}new gmail(s)
GOOGLECALENDAR: ${hr 2}
   ${execi 600 conkyGoogleCalendar -u username@gmail.com -p userspassword -r username@gmail.com}

Openbox config autostart.sh

# Run the system-wide support stuff
. $GLOBALAUTOSTART

# Programs to launch at startup
# =============================

# Start session manager
lxsession &

# Enable power management
### disable it for the purpose of using xscreensaver and sherman's acquarium ?
gnome-power-manager &


# Set keyboard map if different than UK
# Uncomment one to enable, or define your own.
# setxkbmap us & # United States
# setxkbmap ca & # Canada
# setxkbmap fr & # Francais
# setxkbmap br & # Brazil
# setxkbmap de & # Germany
# setxkbmap cz & # Czech Republic
# setxkbmap it & # Italy
# setxkbmap pl & # Poland
# setxkbmap nl & # Netherlands
# etc.

# Force openoffice.org to use GTK theme
# enable this if you install openoffice
export OOO_FORCE_DESKTOP=gnome

# Set-up automounting
pcmanfm --daemon-mode &

# Set desktop wallpaper
nitrogen --restore &

# Enable Keyboard switching through fbxkb and xorg.conf "InputDeice" for keyboard
(sleep 3s && fbxkb) &

# Enable Eyecandy - off by default
# see "/usr/bin/crunchbang/xcompmgr-crunchbang" for more info
# xcompmgr-crunchbang --startstop &

# Start screensaver deamon
### gnome-screensaver &
xscreensaver -no-splash &

# Launch panel
## (sleep 2s && lxpanel) &
## (sleep 2s && tint) &  ## don't use panel(taskbar) change tasks with alt + tab

# Launch system tray -- goes with tint panel
# (sleep 2s && trayer --expand true --transparent true  --alpha 255 --edge top --align right --expand true --SetDockType true --widthtype request --height 24 --margin 220) &
(sleep 2s && trayer --expand true --transparent true  --alpha 255 --edge bottom --align right --expand true --SetDockType true --widthtype request --height 24 --margin 20) &

# Launch network manager applet
(sleep 1s && nm-applet) &

# Launch clipboard manager
(sleep 1s && parcellite) &

# Launch Eee Control
(sleep 1s && eee-control-tray) &

# Uncomment to enable system updates at boot
#(sleep 180s && system-update) &

# Bluetooth indicator
(sleep 5s && bluetooth-applet) &

# start syndaemon to delay touchpad when typing
syndaemon -i 5 -d

# start wbar launchpad docker
# (sleep 3s && wbar -above-desk -isize 30 -idist 1 -zoomf 1.8 -pos bottom -nanim 3 -jumpf 1 -balfa 50 -falfa 0 -bpress) &
(sleep 3s && wbar -jumpf 1 -pos bottom -nanim 3 -zoomf 2.2 -isize 25 -balfa 50 -above-desk -bpress) &
 
# Launch Conky
conky -q &

Gmail notification script

#!/usr/bin/perl

use Switch;
use Text::Wrap;

my $what=$ARGV[0];

$user="me_user"; #username for gmail account
$pass="me_pass"; #password for gmail account
$file="/tmp/gmail.html"; #temporary file to store gmail

#wrap format for subject
$Text::Wrap::columns=65; #Number of columns to wrap subject at
$initial_tab=""; #Tab for first line of subject
$subsequent_tab="\t"; #tab for wrapped lines
$quote="\""; #put quotes around subject

#limit the number of emails to be displayed
$emails=4; #if -1 display all emails

&passwd; #give password the proper url character encoding

switch($what){ #determine what the user wants
    case "n" {&gmail; print "$new\n";} #print number of new emails
    case "s" { #print $from and $subj for new email
        &gmail;
        if ($new>0){
            my $size=@from;
            if ($emails!=-1 && $size>$emails){$size=$emails;} #limit number of emails displayed
            for(my $i=0; $i<$size; ++$i){
                print "From: $from[$i]\n"; #print from line
                $text=$quote.$subj[$i].$quote."\n";
                print wrap($initial_tab, $subsequent_tab, $text); #print subject with word wrap
            }
            $size=@from;
            if ($emails!=-1 && $size >$emails){print "$emails out of $size new emails displayed\n";}
        }
    }     
    case "e" { #print number of new emails, $from, and $subj
        &gmail;
        if($new==0){print "You have no new emails.\n";}
        else{
            print "You have $new new email(s).\n";
            my $size=@from;
            if ($emails!=-1 && $size>$emails){$size=$emails;} #limit number of emails displayed
            for(my $i=0; $i<$size; ++$i){
                print "From: $from[$i]\n"; #print from line
                $text=$quote.$subj[$i].$quote;
                print wrap($initial_tab, $subsequent_tab, $text); #print subject with word wrap
            }
            $size=@from;
            if ($emails!=-1 && $size >$emails){print "$emails out of $size new emails displayed\n";}
        }
    }
    else {
        print "Usage Error: gmail.pl <option>\n";
        print "\tn displays number of new emails\n";
        print "\ts displays from line and subject line for each new email.\n";
        print "\te displays the number of new emails and from line plus \n";
        print "\t\tsubject line for each new email.\n";
    } #didn't give proper option
}

sub gmail{
    if(!(-e $file)){ #create file if it does not exists
        `touch $file`;
    } 

    #get new emails
    `wget -O - https://$user:$pass\@mail.google.com/mail/feed/atom --no-check-certificate> $file`;

    open(IN, $file); #open $file

    my $i=0; #initialize count
    $new=0; #initialize new emails to 0

    my $flag=0;

    while(<IN>){ #cycle through $file
        if(/<entry>/){$flag=1;}
        elsif(/<fullcount>(\d+)<\/fullcount>/){$new=$1;} #grab number of new emails
        elsif($flag==1){ 
            if(/<title>.+<\/title>/){push(@subj, &msg);} #grab new email titles
            elsif(/<name>(.+)<\/name>/){push(@from, $1); $flag=0;} #grab new email from lines
        }
    }

    close(IN); #close $file
}

sub passwd{ #change to url escape codes in password
    #URL ESCAPE CODES
    $_=$pass;
    s/\%/\%25/g;
    s/\#/\%23/g;
    s/\$/\%24/g;
    s/\&/\%26/g;
    s/\//\%2F/g;
    s/\:/\%3A/g;
    s/\;/\%3B/g;
    s/\</\%3C/g;
    s/\=/\%3D/g;
    s/\>/\%3E/g;
    s/\?/\%3F/g;
    s/\@/\%40/g;
    s/\[/\%5B/g;
    s/\\/\%5C/g;
    s/\]/\%5D/g;
    s/\^/\%5E/g;
    s/\`/\%60/g;
    s/\{/\%7B/g;
    s/\|/\%7C/g;
    s/\}/\%7D/g;
    s/\~/\%7E/g;
    $pass=$_;
}

sub msg{
    #THE HTML CODED CHARACTER SET [ISO-8859-1]
    chomp; s/<title>(.+)<\/title>/$1/; #get just the subject
    #now replace any special characters
    s/\&\#33\;/!/g;        #Exclamation mark
    s/\&\#34\;/"/g; s/\&quot\;/"/g;      #Quotation mark
    s/\&\#35\;/#/g;        #Number sign
    s/\&\#36\;/\$/g;        #Dollar sign
    s/\&\#37\;/%/g;        #Percent sign
    s/\&\#38\;/&/g; s/\&amp\;/&/g;        #Ampersand
    s/\&\#39\;/'/g;        #Apostrophe
    s/\&\#40\;/(/g;        #Left parenthesis
    s/\&\#41\;/)/g;        #Right parenthesis
    s/\&\#42\;/*/g;        #Asterisk
    s/\&\#43\;/+/g;        #Plus sign
    s/\&\#44\;/,/g;        #Comma
    s/\&\#45\;/-/g;        #Hyphen
    s/\&\#46\;/./g;        #Period (fullstop)
    s/\&\#47\;/\//g;        #Solidus (slash)
    s/\&\#58\;/:/g;        #Colon
    s/\&\#59\;/\;/g;        #Semi-colon
    s/\&\#60\;/</g; s/\&lt\;/</g;        #Less than
    s/\&\#61\;/=/g;        #Equals sign
    s/\&\#62\;/>/g; s/\&gt\;/>/g;        #Greater than
    s/\&\#63\;/\?/g;        #Question mark
    s/\&\#64\;/\@/g;        #Commercial at
    s/\&\#91\;/\[/g;        #Left square bracket
    s/\&\#92\;/\\/g;        #Reverse solidus (backslash)
    s/\&\#93\;/\]/g;        #Right square bracket
    s/\&\#94\;/\^/g;        #Caret
    s/\&\#95\;/_/g;        #Horizontal bar (underscore)
    s/\&\#96\;/\`/g;        #Acute accent
    s/\&\#123\;/\{/g;        #Left curly brace
    s/\&\#124\;/|/g;        #Vertical bar
    s/\&\#125\;/\}/g;        #Right curly brace
    s/\&\#126\;/~/g;        #Tilde
    s/\&\#161\;/¡/g;        #Inverted exclamation
    s/\&\#162\;/¢/g;        #Cent sign
    s/\&\#163\;/£/g;        #Pound sterling
    s/\&\#164\;/¤/g;        #General currency sign
    s/\&\#165\;/¥/g;        #Yen sign
    s/\&\#166\;/¦/g;        #Broken vertical bar
    s/\&\#167\;/§/g;        #Section sign
    s/\&\#168\;/¨/g;        #Umlaut (dieresis)
    s/\&\#169\;/©/g; s/\&copy\;/©/g;        #Copyright
    s/\&\#170\;/ª/g;        #Feminine ordinal
    s/\&\#171\;/«/g;        #Left angle quote, guillemotleft
    s/\&\#172\;/¬/g;        #Not sign
    s/\&\#174\;/®/g;        #Registered trademark
    s/\&\#175\;/¯/g;        #Macron accent
    s/\&\#176\;/°/g;        #Degree sign
    s/\&\#177\;/±/g;        #Plus or minus
    s/\&\#178\;/²/g;        #Superscript two
    s/\&\#179\;/³/g;        #Superscript three
    s/\&\#180\;/´/g;        #Acute accent
    s/\&\#181\;/µ/g;        #Micro sign
    s/\&\#182\;/¶/g;        #Paragraph sign
    s/\&\#183\;/·/g;        #Middle dot
    s/\&\#184\;/¸/g;        #Cedilla
    s/\&\#185\;/¹/g;        #Superscript one
    s/\&\#186\;/º/g;        #Masculine ordinal
    s/\&\#187\;/»/g;        #Right angle quote, guillemotright
    s/\&\#188\;/¼/g; s/\&frac14\;/¼/g;       # Fraction one-fourth
    s/\&\#189\;/½/g; s/\&frac12\;/½/g;       # Fraction one-half
    s/\&\#190\;/¾/g; s/\&frac34\;/¾/g;       # Fraction three-fourths
    s/\&\#191\;/¿/g;        #Inverted question mark
    s/\&\#192\;/À/g;        #Capital A, grave accent
    s/\&\#193\;/Á/g;        #Capital A, acute accent
    s/\&\#194\;/Â/g;        #Capital A, circumflex accent
    s/\&\#195\;/Ã/g;        #Capital A, tilde
    s/\&\#196\;/Ä/g;        #Capital A, dieresis or umlaut mark
    s/\&\#197\;/Å/g;        #Capital A, ring
    s/\&\#198\;/Æ/g;        #Capital AE dipthong (ligature)
    s/\&\#199\;/Ç/g;        #Capital C, cedilla
    s/\&\#200\;/È/g;        #Capital E, grave accent
    s/\&\#201\;/É/g;        #Capital E, acute accent
    s/\&\#202\;/Ê/g;        #Capital E, circumflex accent
    s/\&\#203\;/Ë/g;        #Capital E, dieresis or umlaut mark
    s/\&\#204\;/Ì/g;        #Capital I, grave accent
    s/\&\#205\;/Í/g;        #Capital I, acute accent
    s/\&\#206\;/Î/g;        #Capital I, circumflex accent
    s/\&\#207\;/Ï/g;        #Capital I, dieresis or umlaut mark   
    s/\&\#208\;/Ð/g;        #Capital Eth, Icelandic
    s/\&\#209\;/Ñ/g;        #Capital N, tilde
    s/\&\#210\;/Ò/g;        #Capital O, grave accent
    s/\&\#211\;/Ó/g;        #Capital O, acute accent
    s/\&\#212\;/Ô/g;        #Capital O, circumflex accent
    s/\&\#213\;/Õ/g;        #Capital O, tilde
    s/\&\#214\;/Ö/g;        #Capital O, dieresis or umlaut mark
    s/\&\#215\;/×/g;        #Multiply sign
    s/\&\#216\;/Ø/g;        #Capital O, slash
    s/\&\#217\;/Ù/g;        #Capital U, grave accent
    s/\&\#218\;/Ú/g;        #Capital U, acute accent
    s/\&\#219\;/Û/g;        #Capital U, circumflex accent
    s/\&\#220\;/Ü/g;        #Capital U, dieresis or umlaut mark
    s/\&\#221\;/Ý/g;        #Capital Y, acute accent
    s/\&\#222\;/Þ/g;        #Capital THORN, Icelandic
    s/\&\#223\;/ß/g;        #Small sharp s, German (sz ligature)
    s/\&\#224\;/à/g;        #Small a, grave accent
    s/\&\#225\;/á/g;        #Small a, acute accent
    s/\&\#226\;/â/g;        #Small a, circumflex accent
    s/\&\#227\;/ã/g;        #Small a, tilde
    s/\&\#228\;/ä/g;        #Small a, dieresis or umlaut mark
    s/\&\#229\;/å/g;        #Small a, ring
    s/\&\#230\;/æ/g;        #Small ae dipthong (ligature)
    s/\&\#231\;/ç/g;        #Small c, cedilla
    s/\&\#232\;/è/g;        #Small e, grave accent
    s/\&\#233\;/é/g;        #Small e, acute accent
    s/\&\#234\;/ê/g;        #Small e, circumflex accent
    s/\&\#235\;/ë/g;        #Small e, dieresis or umlaut mark
    s/\&\#236\;/ì/g;        #Small i, grave accent
    s/\&\#237\;/í/g;        #Small i, acute accent
    s/\&\#238\;/î/g;        #Small i, circumflex accent
    s/\&\#239\;/ï/g;        #Small i, dieresis or umlaut mark
    s/\&\#240\;/ð/g;        #Small eth, Icelandic
    s/\&\#241\;/ñ/g;        #Small n, tilde
    s/\&\#242\;/ò/g;        #Small o, grave accent
    s/\&\#243\;/ó/g;        #Small o, acute accent
    s/\&\#244\;/ô/g;        #Small o, circumflex accent
    s/\&\#245\;/õ/g;        #Small o, tilde
    s/\&\#246\;/ö/g;        #Small o, dieresis or umlaut mark
    s/\&\#247\;/÷/g;        #Division sign
    s/\&\#248\;/ø/g;        #Small o, slash
    s/\&\#249\;/ù/g;        #Small u, grave accent
    s/\&\#250\;/ú/g;        #Small u, acute accent
    s/\&\#251\;/û/g;        #Small u, circumflex accent
    s/\&\#252\;/ü/g;        #Small u, dieresis or umlaut mark
    s/\&\#253\;/ý/g;        #Small y, acute accent
    s/\&\#254\;/þ/g;        #Small thorn, Icelandic
    s/\&\#255\;/ÿ/g;        #Small y, dieresis or umlaut mark
    s/^\s+//;
    return $_;
}

For the ConkyGoogleCalendar.py script search the internet (I think it's in the Google site) to download it

#2 Tips, Tricks & Scripts » Keyboard switching in Openbox (greek and english) - Crunchbang Linux » 2009-02-18 11:29:50

sgk
Replies: 27

I had a problem activating the Keyboard switching in my Eee PC (crunchee linux -8.10.2-). No matter what I did (changes in the xorg.conf, etc) nothing seemed to work. So, here is the solution.

1) To see what keyboard layouts are installed and what key combination to use run
$ xprop -root | grep XKB

2) Install fbxkb
$ sudo apt-get install fbxkb
Go to /usr/share/fbxkb/images and rename zz.png to old_zz.png. Then rename us.png to zz.png. This way you are going to have the american flag shown on the keyboard switching applet when you have chosen US as default locale.

3) run
$ sudo dpkg-reconfigure console-setup
and setup the keyboard (choose pc 105) and the - us,gr- for the keyboard options. Also type - extended - for the XkbVariant to enable the typing of EURO sign. Also choose lctrl_lshft for key combination to switch keyboards.
For some strange reason all changes in /etc/X11/xorg.conf have no effect before you run at least once the dpkg-reconfigure and set the proper values. After that the xorg.conf file can be used to set values for the keyboard to override the default values.

4) To override all the above and set your own (not limited by the reconfigure program) choices edit the /etc/X11/xorg.conf file and include the following

Section "InputDevice"
Identifier  "keyboard"
Driver      "kbd"
Option      "CoreKeyboard"
Option      "XkbRules" "xorg"
Option      "XkbLayout" "us,gr"   
Option      "XkbVariant" ",extended"
Option      "XkbOptions" "grp:shifts_toggle,lv3:ralt_switch"
EndSection

This will allow you to switch keyboards by pressing left and right shifts simultaneously. And the little applet will change flags. You can also switch keyboards by clicking on the fbxkb applet.

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo