"Life is binary, one or zero, life or death"
  • About Me

  • October 21st, 2009

    Sleepy: an usefull Amarok script

    Ok ok, I am strange I know. I like to go to sleep listening to music, but I like to stop the music after a while too.
    Because of this I run a command before get up from my seat:
    $ sleep 20m; amarok -s; exit
    Today I was looking for new apps on kde-apps.org when I looked at sleepy.
    What’s sleepy? Is an Amarok 2.x script, like the old Nightingale that was for Amarok 1.x.
    This script allows you to shutdown/hibernate/suspend the PC after the N song or after N minutes. I love this!
    I don’t know why but this script didn’t allow to stop Amarok without shutdown or suspend the PC. I did a patch that add this feature.
    Obviously, you can find the PKGBUILD on AUR ;)

    EDIT: Author released 0.7.1 which include my patch.

    Goodnight!!!

    December 18th, 2007

    Plugin: Notifiche per weechat

    Dopo aver letto l’articolo sul blog di Cimi che riguardava quest’utile plugin in Python per weechat, l’ho voluto testare e visto che mi “garbava” gli ho anche fatto alcune piccole modifiche:

    • il controllo viene fatto sul nick corrente e non sui nick scritti nel config;
    • il titolo della notifica è ora <channel> on <server> e non solo <channel>;
    • la notifica viene visualizzata solo quando si è away.

    Ho in mente altre modifiche, quindi restate sintonizzati ;)

    Potete scaricare la mia versione del plugin da qui.

    Naturalmente vi prego di scrivermi per qualsiasi segnalazione come errori o suggerimenti ;)

    Nota: richiede python-notify

    September 3rd, 2007

    Script: DE PowerSafe

    Ragazzi sono rientrato ieri dalle vacanze e rientro in grande stile con uno script fresco fresco ;)

    Sul mio laptop ho installato KDE e FluXboX, ma in genere uso solo Flux per “sparagnare” (termine salentino che sta per “risparmiare”) batteria. Qualche volta quando sono con l’alimentazione modifico ~/.xinitrc commentando exec fluxbox e decommentando exec startkde. Non è comodissimo, quindi ho realizzato uno script che verifica se l’alimentazione è a batteria o da cavo (per questo richiede ACPI) e lancia la modalità adeguata (KDE per l’alimentazione via cavo, altrimenti fluxbox).

    Quindi modifico ~/.xinitrc inserendo exec ~/.depowersafe.sh e il gioco è fatto ;)

    Scaricabile dal git.

    Allego il codice dello script depowersafe.sh, spero possa servire a qualcuno ;)

    #!/bin/bash
    #Written by BaSh - http://www.deelab.org/bash/
    #Require ACPI enabled
    BAT=BAT0
    AC=`cat /proc/acpi/battery/$BAT/state | grep "charging state:"|cut -d\ -f12`
    if [ "$AC" = "charged" ] || [ "$AC" = "charging" ]; then
    exec startkde
    else
    exec idesk &
    exec adesklets &
    exec conky &
    exec superswitcher &
    exec fluxbox
    fi
    exit 0

    CC-BY NC SA
    This blog is licensed under the CC-BY NC SA version 3.0 or later.
    Theme is aav1 by Aaron Adams, modified by Andrea Scarpino

    Arch Linux  Wordpress  kde-developer
    FireStats icon Powered by FireStats