Auteur Sujet: OpenBox scripts  (Lu 20483 fois)

0 Membres et 1 Invité sur ce sujet

Hors ligne patrick013

  • Membre Senior
  • ****
  • Messages: 252
OpenBox scripts
« le: 03 mars 2013 à 23:19:13 »
Of all the OB scripts these two work.

Need to work a little to get the url for the weather script.

http://ge.tt/2PEhIzZ/v/0

Hors ligne melodie

  • Administrateur
  • Membre Héroïque
  • *****
  • Messages: 1777
    • Citrotux
Re : OpenBox scripts
« Réponse #1 le: 03 mars 2013 à 23:34:56 »
Hi Patrick013,

I think it would be better if you post the content for each of the 2 files directly here, between code tags

code tags
Good leaders being scarce, following yourself is allowed.

djohnston

  • Invité
Re : OpenBox scripts
« Réponse #2 le: 03 mars 2013 à 23:35:32 »
gweather.py is what I used in DebWeb to display the weather from the Openbox menu.

Hors ligne patrick013

  • Membre Senior
  • ****
  • Messages: 252
Re : Re : OpenBox scripts
« Réponse #3 le: 03 mars 2013 à 23:59:51 »
Hi Patrick013,

I think it would be better if you post the content for each of the 2 files directly here, between code tags

code tags

OK, but any reason   ?

Some of the scripts are a little lengthy, others are not.

regards,

patrick


Hors ligne patrick013

  • Membre Senior
  • ****
  • Messages: 252
Re : Re : OpenBox scripts
« Réponse #4 le: 04 mars 2013 à 00:01:08 »
gweather.py is what I used in DebWeb to display the weather from the Openbox menu.

Well I'm concentrating on Scorpio, things to add, spruce it up
a bit, you know.

Hors ligne melodie

  • Administrateur
  • Membre Héroïque
  • *****
  • Messages: 1777
    • Citrotux
Re : Re : Re : OpenBox scripts
« Réponse #5 le: 04 mars 2013 à 00:11:18 »
OK, but any reason   ?

Yes, our general laziness : I could point to your thread for people on some of the chans where I go more or less each evening, and show the scripts. It's easier to look at if there is no need to download and unpack.

Even a copy paste to pastebin  - http://pastebin.com - and bring the links back here would be better than a tarball to download and unpack.

Good leaders being scarce, following yourself is allowed.

Hors ligne patrick013

  • Membre Senior
  • ****
  • Messages: 252
Re : OpenBox scripts
« Réponse #6 le: 04 mars 2013 à 00:16:11 »
sysinfo.sh

#sysinfo.sh

######## This is a script made
######## by 'yettenet'.
########
######## SysInfo script for OpenBox
######## v0.1
########
######## The author does not take
######## any responsibility for
######## what it might do to your
######## computer, though it's
######## improbable to do any harm.
########
######## You may share the script with
######## everyone and modify it for your
######## liking, as long as you
######## GIVE CREDIT.
########
######## To add it to Openbox, copy it to
######## your Openbox/scripts folder, which usually is at
######## ~/.config/openbox/scripts
########
######## edit your menu.xml file, which usually is at
######## ~/.config/openbox/menu.xml
######## and add the following line (in case you have the usual paths - if not, edit the path as needed):
########
########<menu execute="~/.config/openbox/scripts/sysinfo_v01-by_yettenet.script" id="sysinfo-menu" label="SysInfo"/>
########
######## Below you will find the settings
######## (the script still needs to be tested) 

########  settings

MountPoint1=$(echo /dev/sdc1)
#MountPoint2=$(echo /dev/sda4)
NetworkDevice1=$(echo wlan1)
NetworkDevice2=$(echo eth0)  #Uncomment some lines to make it work!

######## /settings



User=$(whoami)
Host=$(uname -n)
System=$(uname -s)
Release=$(uname -r)
Arch=$(uname -m)

SizeMountPoint1=$(df -HlT | grep "$MountPoint1")
#SizeMountPoint2=$(df -HlT | grep "$MountPoint2")

NetDev1ip=$(/sbin/ifconfig "$NetworkDevice1" | grep "inet addr:" | sed "s/.*inet addr://" | sed "s/Bcast.*//")
NetDev1down=$(/sbin/ifconfig "$NetworkDevice1" | grep bytes | sed 's/.*RX bytes:[0-9]* (//'  | sed 's/iB).*TX.*//' | sed 's/b).*TX.*//' | sed 's/).*TX.*//')
NetDev1up=$(/sbin/ifconfig "$NetworkDevice1" | grep bytes | sed 's/.*TX bytes:[0-9]* (//' | sed 's/iB)//' |sed 's/b).*//' | sed 's/).*//')

NetDev2ip=$(/sbin/ifconfig "$NetworkDevice1" | grep "inet addr:" | sed "s/.*inet addr://" | sed "s/Bcast.*//")
NetDev2down=$(/sbin/ifconfig "$NetworkDevice1" | grep bytes | sed 's/.*RX bytes:[0-9]* (//'  | sed 's/iB).*TX.*//' | sed 's/b).*TX.*//' | sed 's/).*TX.*//')
NetDev2up=$(/sbin/ifconfig "$NetworkDevice1" | grep bytes | sed 's/.*TX bytes:[0-9]* (//' | sed 's/iB)//' |sed 's/b).*//' | sed 's/).*//')

DateDate=$(date '+Date ~ %Y.%m.%d. (%a)')
DateWeek=$(date '+Week ~ %W')
 DateDay=$(date '+ Day ~ %j')
DateTime=$(date '+Time ~ %H:%M [%Z]')
UpTime=$(uptime | sed 's/.* up //' | sed 's/[0-9]* us.*//' | sed 's/ day, /d/' | sed 's/ days, /d /' | sed 's/:/h /' | sed 's/ min//'|  sed 's/,/m/' | sed 's/  / /')

MemTotal=$(echo "scale = 2; ("$(cat /proc/meminfo | grep MemTotal: | awk '{print $2}' | sed 's/k//')" /1024)" | bc)
 MemFree=$(echo "scale = 2; ("$(cat /proc/meminfo | grep MemFree: | awk '{print $2}' | sed 's/k//')" /1024) + ("$(cat /proc/meminfo | grep grep -m 1 Cached: | awk '{print $2}' | sed 's/k//')" /1024)" | bc)
 MemUsed=$(echo "scale = 2; ("$(cat /proc/meminfo | grep MemTotal: | awk '{print $2}' | sed 's/k//')" /1024) - (("$(cat /proc/meminfo | grep MemFree: | awk '{print $2}' | sed 's/k//')" /1024) + ("$(cat /proc/meminfo | grep -m 1 Cached: | awk '{print $2}' | sed 's/k//')" /1024))" | bc)

SwpTotal=$(echo "scale = 2; ("$(cat /proc/meminfo | grep SwapTotal: | awk '{print $2}' | sed 's/k//')" /1024)" | bc)
 SwpFree=$(echo "scale = 2; ("$(cat /proc/meminfo | grep SwapFree: | awk '{print $2}' | sed 's/k//')" /1024)" | bc)
 SwpUsed=$(echo "scale = 2; ("$(cat /proc/meminfo | grep SwapTotal: | awk '{print $2}' | sed 's/k//')" /1024) - ("$(cat /proc/meminfo | grep SwapFree: | awk '{print $2}' | sed 's/k//')" /1024)" | bc)

MemUsedPercent=$(echo "scale = 2; (("$(cat /proc/meminfo | grep MemTotal: | awk '{print $2}' | sed 's/k//')" /1024) - (("$(cat /proc/meminfo | grep MemFree: | awk '{print $2}' | sed 's/k//')" /1024) + ("$(cat /proc/meminfo | grep -m 1 Cached: | awk '{print $2}' | sed 's/k//')" /1024))) / ("$(cat /proc/meminfo | grep MemTotal: | awk '{print $2}' | sed 's/k//')" /1024) *100" | bc)
SwpUsedPercent=$(echo "scale = 2; (("$(cat /proc/meminfo | grep SwapTotal: | awk '{print $2}' | sed 's/k//')" /1024) - ("$(cat /proc/meminfo | grep SwapFree: | awk '{print $2}' | sed 's/k//')" /1024)) / ("$(cat /proc/meminfo | grep SwapTotal: | awk '{print $2}' | sed 's/k//')" /1024) *100" | bc)

CPUmodel=$(cat /proc/cpuinfo | grep "model name" | sed 's/.*: //')
CPUfreq=$(cat /proc/cpuinfo | grep -m 1 "cpu MHz" | sed 's/.*: //')
CPUcache=$(cat /proc/cpuinfo | grep -m 1 "cache size" | sed 's/.*: //')


echo "<openbox_pipe_menu>"
echo "<separator label=\"$User @ $Host \"/>"
echo "<item label=\"$System $Release $Arch\"/>"

echo "<separator label = \"Filesystem ~~ Type ~~ Total ~ Used ~ Free ~ % ~ Mount   \"/>"
echo "<item label=\"$SizeMountPoint1\"/>"
#echo "<item label=\"$SizeMountPoint2\"/>"

echo "<separator label=\"CPU ~ RAM ~ Swap | Used/Total     \"/>"
echo "<item label=\"RAM used: $MemUsed MiB/$MemTotal MiB ~ $MemUsedPercent%\"/>"
echo "<item label=\"Swp used: $SwpUsed MiB/$SwpTotal MiB ~ $SwpUsedPercent%\"/>"
echo "<item label=\"CPU ~ $CPUmodel\"/>"
echo "<item label=\"CPU @ $CPUfreq MHz  ~  CPU Cache: $CPUcache\"/>"

echo "<separator label = \"Network ~ "$NetworkDevice1"  \"/>"
echo "<item label=\""$NetworkDevice1" ~         ip: $NetDev1ip\"/>"
echo "<item label=\""$NetworkDevice1" ~ downloaded: "$NetDev1down"iB\"/>"
echo "<item label=\""$NetworkDevice1" ~   uploaded: "$NetDev1up"iB\"/>"

#echo "<separator label = \"Network ~ "$NetworkDevice2"  \"/>"
#echo "<item label=\""$NetworkDevice1" ~         ip: $NetDev2ip\"/>"
#echo "<item label=\""$NetworkDevice1" ~ downloaded: "$NetDev2down"iB\"/>"
#echo "<item label=\""$NetworkDevice1" ~   uploaded: "$NetDev2up"iB\"/>"

echo "<separator label = \"Date ~ Time\"/>"
echo "<item label=\"$DateDate\"/>"
echo "<item label=\"$DateWeek\"/>"
echo "<item label=\"$DateDay\"/>"
echo "<item label=\"$DateTime\"/>"
echo "<item label=\"  Up ~ $UpTime\"/>"

echo "</openbox_pipe_menu>"





gweather.py


#gweather.py

#!/usr/bin/python -o
# -*- coding: utf-8 -*-

from urllib import urlopen, quote
from xml.etree.cElementTree import parse
from datetime import datetime, timedelta
import os
from os.path import join
from sys import argv
try:
    import cPickle as pickle
except ImportError:
    import pickle


TRANSLATED_TEXT = {
    'en': {
        'current': 'Current conditions',
        'weather': 'Weather',
        'temp': 'Temperature',
        'humidity': 'Humidity',
        'wind': 'Wind',
        'forecast': 'Forecast',
        'mintemp': 'Minimun Temperature',
        'maxtemp': 'Maximun Temperature'
    },
    'es': {
        'current': u'Actualmente',
        'weather': u'Tiempo',
        'temp': u'Temperatura',
        'humidity': u'Humedad',
        'wind': u'Viento',
        'forecast': u'Previsión',
        'mintemp': u'Temperatura Mínima',
        'maxtemp': u'Temperatura Máxima'
    },
    'fr': {
        'current': u'Actuel',
        'weather': u'Météo',
        'temp': u'Température',
        'humidity': u'Humidité',
        'wind': u'Vent',
        'forecast': u'Prévision',
        'mintemp': u'Température minimale',
        'maxtemp': u'Température maximale'
    },
    'de': {
        'current': u'Aktuell',
        'weather': u'Wetter',
        'temp': u'Temperatur',
        'humidity': u'Luftfeuchtigkeit',
        'wind': u'Wind',
        'forecast': u'Prognostizieren',
        'mintemp': u'Minimale Temperatur',
        'maxtemp': u'Höchste Temperatur'
    }
}


if len(argv) != 3:
    raise Exception('Usage: gweather.py city language.')
else:
    city = argv[1]
    lang = argv[2]



CACHE_HOURS = 1

WEATHER_URL = 'http://www.google.com/ig/api?weather=%s&hl=%s&oe=UTF-8'


def get_weather(city, lang):
    url = WEATHER_URL % (quote(city), quote(lang))
    data = parse(urlopen(url))
   
    forecasts = []
    for forecast in data.findall('weather/forecast_conditions'):
        forecasts.append(
    dict([(element.tag, element.get("data")) for element in forecast.getchildren()]))
   
    return {
        'forecast_information': dict([(element.tag, element.get("data")) for element in data.find('weather/forecast_information').getchildren()]),
        'current_conditions': dict([(element.tag, element.get("data")) for element in data.find('weather/current_conditions').getchildren()]),
        'forecasts': forecasts
    }

def get_openbox_pipe_menu(lang, forecast_information, current_conditions, forecasts):
    if lang == 'en-US':
        lang = 'en'
   
    tt = TRANSLATED_TEXT[lang]
   
    temp_var, temp_unit = ("temp_c", u"\u00b0C") if forecast_information['unit_system'] == "SI" else ("temp_f", "F")
   
    output = '<openbox_pipe_menu>'
    output += '\n<separator label="%s (%s)" />' % (weather['forecast_information']['city'],forecast_information['forecast_date'])
    output += '\n<separator label="%s" />' % tt['current']
    output += '<item label="%s: %s" />' % (tt['weather'], current_conditions['condition'])
    output += '<item label="%s: %s %s" />' % (tt['temp'], current_conditions[temp_var], temp_unit)
    output += '<item label="%s: %s" />' % (tt['humidity'], current_conditions['humidity'])
    output += '<item label="%s: %s" />' % (tt['wind'], current_conditions['wind_condition'])
    for forecast in forecasts:
        output += '\n<separator label="%s: %s" />' % (tt['forecast'], forecast['day_of_week'])
        output += '<item label="%s: %s" />' % (tt['weather'], forecast['condition'])
        output += '<item label="%s: %s %s" />' % ( tt['mintemp'], forecast['low'], temp_unit )
        output += '<item label="%s: %s %s" />' % ( tt['maxtemp'], forecast['high'], temp_unit )
    output += '\n</openbox_pipe_menu>'
   
    return output.encode('utf-8')

cache_file = join(os.getenv("HOME"), '.gweather.cache')

try:
    f = open(cache_file,'rb')
    cache = pickle.load(f)
    f.close()
except IOError:
    cache = None

if cache == None or (city, lang) not in cache or (
        cache[(city, lang)]['date'] + timedelta(hours=CACHE_HOURS) < datetime.utcnow()):
    # The cache is outdated
    weather = get_weather(city, lang)
    ob_pipe_menu = get_openbox_pipe_menu(lang, **weather)
    print ob_pipe_menu
    if cache == None:
        cache = dict()
    cache[(city, lang)] = {'date': datetime.utcnow(), 'ob_pipe_menu': ob_pipe_menu}
   
    #Save the data in the cache
    try:
        f = open(cache_file, 'wb')
        cache = pickle.dump(cache, f, -1)
        f.close()
    except IOError:
        raise
else:
    print cache[(city, lang)]['ob_pipe_menu']




both scripts.
« Modifié: 04 mars 2013 à 00:25:52 par patrick013 »

Hors ligne melodie

  • Administrateur
  • Membre Héroïque
  • *****
  • Messages: 1777
    • Citrotux
Re : OpenBox scripts
« Réponse #7 le: 04 mars 2013 à 01:37:59 »
Hi again,

Citer
#sysinfo.sh

######## This is a script made
######## by 'yettenet'.

who is "yettenet"? Does he have a mail address ? ^^

Good leaders being scarce, following yourself is allowed.

Hors ligne patrick013

  • Membre Senior
  • ****
  • Messages: 252
Re : Re : OpenBox scripts
« Réponse #8 le: 04 mars 2013 à 02:05:07 »
Hi again,

who is "yettenet"? Does he have a mail address ? ^^

Hi Mel,

I don't know.   I got these from an OB scripts website.
Had them for awhile, can't remember the exact website,
nothing in history, I've changed browsers lately.

Need to designate it a pipemenu, sysinfo-menu, then
configure a few lines within the script.

Voila,

Some system info, not the best but something, you know.
Need to see my menu.xml let me know.

regards,

patrickl

Hors ligne patrick013

  • Membre Senior
  • ****
  • Messages: 252
Re : OpenBox scripts
« Réponse #9 le: 04 mars 2013 à 02:13:00 »
This weather script is better, just follow the script command with
your zip code and fahrenheit or celsius, the pipemenu works then.

pipe-weather is the pipemenu

yweather.py


#yweather.py

#!/usr/bin/python

import urllib
from xml.etree.cElementTree import parse
from datetime import datetime, timedelta
import os
from os.path import join
from sys import argv
try:
    import cPickle as pickle
except ImportError:
    import pickle

#Usage: yweather.py AYXX0001 Celsius

if len(argv) != 3:
    raise Exception('Usage: yweather.py zip_code units. zip_code is your city code in Yahoo Weather, units can be Celsius or Fahrenheit.')
else:
    zip_code = argv[1]
    if argv[2] == 'Fahrenheit' or argv[2] == 'fahrenheit':
        units = 'f'
    else:
        units = 'c'



CACHE_HOURS = 6

#http://weather.yahooapis.com/forecastrss
WEATHER_URL = 'http://xml.weather.yahoo.com/forecastrss?p=%s&u=%s'
WEATHER_NS = 'http://xml.weather.yahoo.com/ns/rss/1.0'

def weather_for_zip(zip_code, units):
    url = WEATHER_URL % (zip_code, units)
    rss = parse(urllib.urlopen(url)).getroot()
    forecasts = []
    for element in rss.findall('channel/item/{%s}forecast' % WEATHER_NS):
        forecasts.append(dict(element.items()))
    ycondition = rss.find('channel/item/{%s}condition' % WEATHER_NS)
    return {
        'current_condition': dict(ycondition.items()),
        'forecasts': forecasts,
        'title': rss.findtext('channel/title'),
        'pubDate': rss.findtext('channel/item/pubDate'), #rss.findtext('channel/lastBuildDate'),
        'location': dict(rss.find('channel/{%s}location' % WEATHER_NS).items()),
        'wind': dict(rss.find('channel/{%s}wind' % WEATHER_NS).items()),
        'atmosphere': dict(rss.find('channel/{%s}atmosphere' % WEATHER_NS).items()),
        'astronomy': dict(rss.find('channel/{%s}astronomy' % WEATHER_NS).items()),
        'units': dict(rss.find('channel/{%s}units' % WEATHER_NS).items())
    }

def print_openbox_pipe_menu(weather):
    print '<openbox_pipe_menu>'
    print '<separator label="%s %s" />' % (weather['location']['city'],weather['pubDate'])
    print '<separator label="Current conditions" />'
    print '<item label="Weather: %s" />' % weather['current_condition']['text']
    print '<item label="Temperature: %s %s" />' % ( weather['current_condition']['temp'],
                                          weather['units']['temperature'] )
    print '<item label="Humidity: %s%%" />' % weather['atmosphere']['humidity']
    print '<item label="Visibility: %s %s" />' % ( weather['atmosphere']['visibility'],
                                          weather['units']['distance'] )
   
    #pressure: steady (0), rising (1), or falling (2)
    if weather['atmosphere']['rising'] == 0:
        pressure_state = 'steady'
    elif weather['atmosphere']['rising'] == 1:
        pressure_state = 'rising'
    else:
        pressure_state = 'falling'
    print '<item label="Pressure: %s %s (%s)" />' % ( weather['atmosphere']['pressure'],
                                          weather['units']['pressure'], pressure_state )
    print '<item label="Wind chill: %s %s" />' % ( weather['wind']['chill'],
                                          weather['units']['temperature'] )
    print '<item label="Wind direction: %s degrees" />' % weather['wind']['direction']
    print '<item label="Wind speed: %s %s" />' % ( weather['wind']['speed'],
                                          weather['units']['speed'] )
    print '<item label="Sunrise: %s" />' % weather['astronomy']['sunrise']
    print '<item label="Sunset: %s" />' % weather['astronomy']['sunset']
    for forecast in weather['forecasts']:
        print '<separator label="Forecast: %s" />' % forecast['day']
        print '<item label="Weather: %s" />' % forecast['text']
        print '<item label="Min temperature: %s %s" />' % ( forecast['low'],
                                                weather['units']['temperature'] )
        print '<item label="Max temperature: %s %s" />' % ( forecast['high'],
                                                weather['units']['temperature'] )
    print '</openbox_pipe_menu>'

cache_file = join(os.getenv("HOME"), '.yweather.cache')

try:
    f = open(cache_file,'rb')
    cache = pickle.load(f)
    f.close()
except IOError:
    cache = None

if cache == None or (zip_code, units) not in cache or (
        cache[(zip_code, units)]['date'] + timedelta(hours=CACHE_HOURS) < datetime.utcnow()):
    # The cache is outdated
    weather = weather_for_zip(zip_code, units)
    if cache == None:
        cache = dict()
    cache[(zip_code, units)] = {'date': datetime.utcnow(), 'weather': weather}
   
    #Save the data in the cache
    try:
        f = open(cache_file, 'wb')
        cache = pickle.dump(cache, f, -1)
        f.close()
    except IOError:
        raise
else:
    weather = cache[(zip_code, units)]['weather']


print_openbox_pipe_menu(weather)




I've got the sysinfo.sh and yweather.py both working in Scorpio,
just finished that.

Questions or a copy of my menu.xml just ask.

Aren't computers fun ?

regards,

patrick

Hors ligne melodie

  • Administrateur
  • Membre Héroïque
  • *****
  • Messages: 1777
    • Citrotux
Re : OpenBox scripts
« Réponse #10 le: 04 mars 2013 à 02:13:19 »
I am not sure I fully understand what this script does ?

Good leaders being scarce, following yourself is allowed.

Hors ligne patrick013

  • Membre Senior
  • ****
  • Messages: 252
Re : Re : OpenBox scripts
« Réponse #11 le: 04 mars 2013 à 02:57:20 »
I am not sure I fully understand what this script does ?

Here's my menu.xml, perhaps rename yours and replace it with this
temporarily.   yweather.py and sysinfo.sh are in my /usr/bin.   sysinfo
should need an UUID and weather needs a zip code.

You can see what's going on in obmenu then.

<?xml version="1.0" encoding="utf-8"?>
<openbox_menu xmlns="http://openbox.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://openbox.org/                 file:///usr/share/openbox/menu.xsd">
<menu id="root-menu" label="Openbox 3">
<!--<menu id="desktop-app" label="Applications" execute="openbox-menu lxde-applications.menu -g -t 'xterm -e'" />-->
<menu execute=" cat ~/.cache/menu.xml" id="desktop-app" label="Applications"/>
<!-- This requires the presence of the 'menu' package to work
  <menu id="/Debian" />-->
<menu execute="~/.config/openbox/pipemenus/places_menu.sh" id="places" label="Places"/>
<separator/>
<item label="File Manager SU">
<action name="Execute">
<execute>gksu pcmanfm</execute>
</action>
</item>
<item label="Terminal">
<action name="Execute">
<execute>gnome-terminal</execute>
</action>
</item>
<item label="Editor">
<action name="Execute">
<execute>leafpad</execute>
</action>
</item>
<item label="Web browser">
<action name="Execute">
<execute>x-www-browser</execute>
</action>
</item>
<separator/>
<menu id="openbox-menu" label="OpenBox">
<item label="Reconfigure">
<action name="Reconfigure"/>
</item>
<item label="ObConf">
<action name="Execute">
<command>obconf</command>
</action>
</item>
<item label="Desktop Shortcuts">
<action name="Execute">
<command>/usr/local/bin/short</command>
</action>
</item>
<item label="Edit Autostart">
<action name="Execute">
<execute>leafpad /home/guest/.config/openbox/autostart</execute>
</action>
</item>
<menu execute="/usr/bin/sysinfo.sh" id="sysinfo-menu" label="System Info"/>
<menu execute="yweather.py 60610 Fahrenheit" id="pipe-weather" label="Weather"/>
<item label="Restart">
<action name="Restart"/>
</item>
</menu>
<separator/>
<menu id="screenshot" label="Screenshot">
<item label="Now">
<action name="Execute">
<execute>
scrot '%Y-%m-%d--%s_$wx$h_scrot.png' -e 'mv $f ~/Pictures/ &amp; geeqie ~/Pictures/$f'
</execute>
</action>
</item>
<item label="In 5 Seconds...">
<action name="Execute">
<execute>
scrot -d 5 '%Y-%m-%d--%s_$wx$h_scrot.png' -e 'mv $f ~/Pictures/ &amp; geeqie ~/Pictures/$f'
</execute>
</action>
</item>
<item label="In 10 Seconds...">
<action name="Execute">
<execute>
scrot -d 10 '%Y-%m-%d--%s_$wx$h_scrot.png' -e 'mv $f ~/Pictures/ &amp; geeqie ~/Pictures/$f'
</execute>
</action>
</item>
<item label="Selected Area... (click &amp; drag mouse)">
<action name="Execute">
<execute>
scrot -s '%Y-%m-%d--%s_$wx$h_scrot.png' -e 'mv $f ~/Pictures/ &amp; geeqie ~/Pictures/$f'
</execute>
</action>
</item>
</menu>
<separator/>
<!--<item label="Exit">
<action name="Exit" />
</item>-->
<menu id="root-menu-312949" label="Exit">
<item label="Shutdown">
<action name="Execute">
<execute>gksu pygtk-shutdown</execute>
</action>
</item>
<separator/>
<item label="Screensaver Off">
<action name="Execute">
<execute>xset dpms 0 0 0</execute>
</action>
</item>
<item label="Screensaver On ">
<action name="Execute">
<execute>xset dpms 0 0 10 </execute>
</action>
</item>
<item label="Lock Screen">
<action name="Execute">
<execute>i3lock -c &quot;#000000&quot;  </execute>
</action>
</item>
</menu>
</menu>
</openbox_menu>

Hors ligne melodie

  • Administrateur
  • Membre Héroïque
  • *****
  • Messages: 1777
    • Citrotux
Re : OpenBox scripts
« Réponse #12 le: 04 mars 2013 à 03:43:35 »
Hi,

Please just tell me:

what do you expect it to do ? What does it do instead ?

« Modifié: 04 mars 2013 à 03:45:48 par mélodie »
Good leaders being scarce, following yourself is allowed.

Hors ligne patrick013

  • Membre Senior
  • ****
  • Messages: 252
Re : Re : OpenBox scripts
« Réponse #13 le: 04 mars 2013 à 04:02:09 »
Hi,

Please just tell me:

what do you expect it to do ? What does it do instead ?

The weather script tells me if it's snowing tomorrow.

The sysinfo script tells me a little bit about the system.

Nothing fantastic, nothing more nothing less.    Better ?
Maybe not.

djohnston

  • Invité
Re : OpenBox scripts
« Réponse #14 le: 04 mars 2013 à 05:14:55 »
melodie,

The weather python script is, as Patrick says, a script called from an Openbox pipe menu to display the weather. The one I used on DebWeb is actually gweather3.py. Here's the screenshot again, from the first post of the DebWeb thread.