RSS Mobile
 
tumblr:~ blog$ /usr/bin/alex --fortune

 


6 Dicembre, 2008
text

bash scripting - VGA toggle switch

VGA port, really useful way to display through big Monitor or TV your tiny videos instead of watching them on your little notebook’s display :-)

Are you bored to have to restart X every time you want to connect your VGA cable?

Don’t you want to use gnome-display-etc-etc-manager to only configure a stupid VGA Monitor?

Don’t worry, you can use a little bash script (linked to some buttons on you panels), to manage your VGA connection.

I works like a switch, the script will enable the output choiced if this is disabled and viceversa it will disable the output if this is enabled.

But stop speaking (/writing) and watch it now:

vga.sh:

#!/bin/bash
#
# This script was created to manage an external output for notebook
#    The script only needs a bit of configuration to set the default output, mode, rate and extra options,
#    It works like a switch, the script will enable the output choiced if this is disabled and viceversa it will disable
#        the output if this is enabled.
#    It can be used on various acpi script linking it to your notebook’s fn+key.
#
# Made by: Alessandro Arrichiello <alezzandro@gmail.com>
#
# Configuration starts here:

output=”VGA”
mode=”1024x768”
rate=”60”
extra_options=”—right-of LVDS”
xrandr_cmd=”xrandr —output “$output” —mode “$mode” —rate “$rate” “$extra_options

#
# END of Configuration

xrandr_output=`xrandr|grep $output`

if [ `echo $xrandr_output|grep -c disconnected` == “1” ]; then
echo “Cable for “$output” not connected.”
else
if [ `echo $xrandr_output|grep -c connected` == “1” ]; then
if [ `echo $xrandr_output|grep -c $mode` == “1” ]; then
echo “Putting off: “$output
xrandr —output $output —off
else
echo “Putting on: “$output
`$xrandr_cmd`
fi

else
echo “Output not found check your configuration.”

fi
fi

Remember to set the right permissions (chmod +x vga.sh),

see you,

18 Giugno, 2008
text

torrentmanager on code.alexworld.it

Today I’ve published a little but powerful SH script to manage torrent files with enhanced-ctorrent (already known as: ctorrent).

You can find it on: http://code.alexworld.it

or directly here: http://code.alexworld.it/code/torrentmanager.sh.html

Have a nice day!

Alessandro.

HomeWebsite Homepage RSSTake the RSS! ArchiveLook at Blog Archives
MailMeSend me an eMail MailgpgTake my gpg key
Skype
Add me to Your Skype Account
ChatChat with Me! WorksLook my Works FlickLook my Picasa Photo Album!
YoutubeLook my Videos on Youtube! del.icio.usLook my bookmarks on del.icio.us! TechnoratiAdd to Technorati Favorites!
VimeoHDMy HD Videos on Vimeo! GoogleGo to Google! MTV-nomafieGo to MTV nomafie!


Visualizza il profilo di Alessandro Arrichiello su LinkedIn