]> Dogcows Code - chaz/openbox/commitdiff
Merge branch 'backport'
authorDana Jansens <danakj@orodu.net>
Sun, 10 Feb 2008 00:07:55 +0000 (19:07 -0500)
committerDana Jansens <danakj@orodu.net>
Sun, 10 Feb 2008 00:07:55 +0000 (19:07 -0500)
Makefile.am
data/autostart.sh
openbox/screen.c
po/cs.po
po/sv.po
tools/xdg-autostart/xdg-autostart [new file with mode: 0755]

index fc873bb113eef1e4ded1266d8920647e76a11a53..d8dba2c7a27cdbcfce52c614bc8e2632b88e0703 100644 (file)
@@ -32,6 +32,9 @@ bin_PROGRAMS = \
        openbox/openbox \
        tools/gnome-panel-control/gnome-panel-control
 
+bin_SCRIPTS = \
+       tools/xdg-autostart/xdg-autostart
+
 nodist_bin_SCRIPTS = \
        data/xsession/openbox-session \
        data/xsession/openbox-gnome-session \
index 4c6352029b3fd46eee0911ebb2a9f14abb9dfb72..ab5428417cd1394a5729d6f7a00876935b592360 100644 (file)
@@ -30,3 +30,10 @@ fi
 if which start_kdeinit >/dev/null; then
   LD_BIND_NOW=true start_kdeinit --new-startup +kcminit_startup &
 fi
+
+# Run XDG autostart things.  By default don't run anything desktop-specific
+# See xdg-autostart --help more info
+DESKTOP_ENV=""
+if which xdg-autostart; then
+  xdg-autostart $DESKTOP_ENV
+fi
index 9135353897bef24aac80fbdbbc4a1f1b2b7c36dd..90f8b27c76cbd13c29c74c07e78ab79cf9bfd8e9 100644 (file)
@@ -58,7 +58,7 @@ static void     screen_fallback_focus(void);
 guint    screen_num_desktops;
 guint    screen_num_monitors;
 guint    screen_desktop;
-guint    screen_last_desktop = 1;
+guint    screen_last_desktop;
 gboolean screen_showing_desktop;
 ObDesktopLayout screen_desktop_layout;
 gchar  **screen_desktop_names;
index 7b8d2f988df9f82be980f5186a21e49902c79c42..c78d73838b0acee9f788c37530813db868d5399e 100644 (file)
--- a/po/cs.po
+++ b/po/cs.po
@@ -5,10 +5,10 @@
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: Openbox 3.4.3\n"
+"Project-Id-Version: Openbox 3.4.6\n"
 "Report-Msgid-Bugs-To: http://bugzilla.icculus.org\n"
-"POT-Creation-Date: 2008-02-02 11:51-0500\n"
-"PO-Revision-Date: 2007-07-21 00:15+0200\n"
+"POT-Creation-Date: 2008-02-09 09:34+0100\n"
+"PO-Revision-Date: 2008-02-09 09:33+0100\n"
 "Last-Translator: tezlo <tezlo@gmx.net>\n"
 "Language-Team: Czech <cs@li.org>\n"
 "MIME-Version: 1.0\n"
@@ -32,33 +32,33 @@ msgstr "Nepodařilo se spustit '%s': %s"
 
 #: openbox/client.c:1988 openbox/client.c:2020
 msgid "Killing..."
-msgstr ""
+msgstr "Ukončování..."
 
 #: openbox/client.c:1990 openbox/client.c:2022
 msgid "Not Responding"
-msgstr ""
+msgstr "Neodpovídá"
 
 #: openbox/client_list_combined_menu.c:91 openbox/client_list_menu.c:94
 msgid "Go there..."
 msgstr "Jdi tam..."
 
-#: openbox/client_list_combined_menu.c:97
+#: openbox/client_list_combined_menu.c:98
 msgid "Manage desktops"
 msgstr "Spravovat plochy"
 
-#: openbox/client_list_combined_menu.c:98 openbox/client_list_menu.c:157
+#: openbox/client_list_combined_menu.c:99 openbox/client_list_menu.c:158
 msgid "_Add new desktop"
 msgstr "_Přidat novou plochu"
 
-#: openbox/client_list_combined_menu.c:99 openbox/client_list_menu.c:158
+#: openbox/client_list_combined_menu.c:100 openbox/client_list_menu.c:159
 msgid "_Remove last desktop"
 msgstr "_Odstranit poslední plochu"
 
-#: openbox/client_list_combined_menu.c:151
+#: openbox/client_list_combined_menu.c:153
 msgid "Windows"
 msgstr "Okna"
 
-#: openbox/client_list_menu.c:204
+#: openbox/client_list_menu.c:206
 msgid "Desktops"
 msgstr "Plochy"
 
@@ -122,7 +122,7 @@ msgstr "Oz_dobit/Odzdobit"
 msgid "_Close"
 msgstr "_Zavřít"
 
-#: openbox/config.c:750
+#: openbox/config.c:754
 #, c-format
 msgid "Invalid button '%s' specified in config file"
 msgstr "Neplatné tlačítko '%s' v konfiguračním souboru"
@@ -255,7 +255,7 @@ msgstr "  --restart           Restartovat Openbox\n"
 
 #: openbox/openbox.c:507
 msgid "  --exit              Exit Openbox\n"
-msgstr ""
+msgstr "  --exit              Ukončit Openbox\n"
 
 #: openbox/openbox.c:508
 msgid ""
@@ -290,11 +290,11 @@ msgstr ""
 "\n"
 "Prosím hlašte chyby na %s\n"
 
-#: openbox/openbox.c:583
+#: openbox/openbox.c:582
 msgid "--config-file requires an argument\n"
-msgstr ""
+msgstr "--config-file vyžaduje argument\n"
 
-#: openbox/openbox.c:626
+#: openbox/openbox.c:625
 #, c-format
 msgid "Invalid command line argument '%s'\n"
 msgstr "Neplatný argument příkazové řádky '%s'\n"
@@ -320,6 +320,8 @@ msgid ""
 "Openbox is configured for %d desktops, but the current session has %d.  "
 "Overriding the Openbox configuration."
 msgstr ""
+"Openbox je konfigurován pro %d ploch, ale současné sezení má %d.  "
+"KOnfigurace Openboxu bude změněna."
 
 #: openbox/screen.c:1169
 #, c-format
index 337ecd1364553c44e57f2bdbbb4a486a12313228..1c4ad1d351be7987ce343447743156218cef61eb 100644 (file)
--- a/po/sv.po
+++ b/po/sv.po
@@ -5,10 +5,10 @@
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: Openbox 3.4.6\n"
+"Project-Id-Version: Openbox 3.4.6.1\n"
 "Report-Msgid-Bugs-To: http://bugzilla.icculus.org\n"
-"POT-Creation-Date: 2008-02-02 11:51-0500\n"
-"PO-Revision-Date: 2008-01-25 03:52+0100\n"
+"POT-Creation-Date: 2008-02-09 09:34+0100\n"
+"PO-Revision-Date: 2008-02-09 09:41+0100\n"
 "Last-Translator: Mikael Magnusson <mikachu@icculus.org>\n"
 "Language-Team: None\n"
 "MIME-Version: 1.0\n"
@@ -42,23 +42,23 @@ msgstr "Svarar Inte"
 msgid "Go there..."
 msgstr "Gå dit..."
 
-#: openbox/client_list_combined_menu.c:97
+#: openbox/client_list_combined_menu.c:98
 msgid "Manage desktops"
 msgstr "Hantera skrivbord"
 
-#: openbox/client_list_combined_menu.c:98 openbox/client_list_menu.c:157
+#: openbox/client_list_combined_menu.c:99 openbox/client_list_menu.c:158
 msgid "_Add new desktop"
 msgstr "_Lägg till nytt skrivbord"
 
-#: openbox/client_list_combined_menu.c:99 openbox/client_list_menu.c:158
+#: openbox/client_list_combined_menu.c:100 openbox/client_list_menu.c:159
 msgid "_Remove last desktop"
 msgstr "_Ta bort sista skrivbordet"
 
-#: openbox/client_list_combined_menu.c:151
+#: openbox/client_list_combined_menu.c:153
 msgid "Windows"
 msgstr "Fönster"
 
-#: openbox/client_list_menu.c:204
+#: openbox/client_list_menu.c:206
 msgid "Desktops"
 msgstr "Skrivbord"
 
@@ -122,7 +122,7 @@ msgstr "_Dekorationer"
 msgid "_Close"
 msgstr "Stän_g"
 
-#: openbox/config.c:750
+#: openbox/config.c:754
 #, c-format
 msgid "Invalid button '%s' specified in config file"
 msgstr "Ogiltig knapp '%s' angiven i konfigurationsfilen"
@@ -230,7 +230,7 @@ msgstr "  --replace           Ers
 
 #: openbox/openbox.c:502
 msgid "  --config-file FILE  Specify the path to the config file to use\n"
-msgstr ""
+msgstr "  --config-file FIL   Ange sökvägen till konfigurationsfil att använda\n"
 
 #: openbox/openbox.c:503
 msgid "  --sm-disable        Disable connection to the session manager\n"
@@ -289,11 +289,11 @@ msgstr ""
 "\n"
 "Rapportera buggar till %s\n"
 
-#: openbox/openbox.c:583
+#: openbox/openbox.c:582
 msgid "--config-file requires an argument\n"
 msgstr ""
 
-#: openbox/openbox.c:626
+#: openbox/openbox.c:625
 #, c-format
 msgid "Invalid command line argument '%s'\n"
 msgstr "Ogiltigt kommandoradsargument '%s'\n"
diff --git a/tools/xdg-autostart/xdg-autostart b/tools/xdg-autostart/xdg-autostart
new file mode 100755 (executable)
index 0000000..daa9117
--- /dev/null
@@ -0,0 +1,198 @@
+#!/usr/bin/env python
+
+# xdg-autostart runs things based on the XDG autostart specification
+# Copyright (C) 2008       Dana Jansens
+#
+# XDG autostart specification can be found here:
+# http://standards.freedesktop.org/autostart-spec/
+#
+#
+#
+# LICENSE:
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   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.
+
+ME="xdg-autostart"
+VERSION="1.0"
+
+import os, glob, sys
+try:
+    from xdg import BaseDirectory
+    from xdg.DesktopEntry import DesktopEntry
+    from xdg.Exceptions import ParsingError
+except ImportError:
+    print
+    print "ERROR:", ME, "requires PyXDG to be installed"
+    print
+    sys.exit(1)
+
+def main(argv=sys.argv):
+    if "--help" in argv[1:]:
+        show_help()
+        return 0
+    if "--version" in argv[1:]:
+        show_version()
+        return 0
+
+    # get the autostart directories
+    autodirs = BaseDirectory.load_config_paths("autostart")
+
+    # find all the autostart files
+    files = []
+    for dir in autodirs:
+        for path in glob.glob(os.path.join(dir, '*.desktop')):
+            try:
+                autofile = AutostartFile(path)
+            except ParsingError:
+                print "Invalid .desktop file: " + path
+            else:
+                if not autofile in files:
+                    files.append(autofile)
+
+    list = False
+    if "--list" in argv[1:]:
+        list = True
+        argv.remove("--list")
+
+    # run them !
+    environments = argv[1:]
+    for autofile in files:
+        if list: autofile.list(environments)
+        else: autofile.run(environments)
+
+class AutostartFile():
+    def __init__(self, path):
+        self.path = path
+        self.filename = os.path.basename(path)
+        self.dirname = os.path.dirname(path)
+        self.de = DesktopEntry(path)
+
+    def __eq__(self, other):
+        return self.filename == other.filename
+
+    def __str__(self):
+        return self.path + " : " + self.de.getName()
+
+    def isexecfile(path):
+        return os.access(path, os.X_OK)
+
+    def findFile(self, path, search, match_func):
+        # check empty path
+        if not path: return None
+        # check absolute path
+        if path[0] == '/':
+            if match_func(path): return path
+            else: return None
+            # check relative path
+            for dirname in search.split(os.pathsep):
+                if dirname != "":
+                    candidate = os.path.join(dirname, path)
+                    if (match_func(candidate)): return candidate
+
+    def alert(self, str, info=False):
+        if info:
+            print "\t ", str
+        else:
+            print "\t*", str
+
+    def showInEnvironment(self, envs, verbose=False):
+        default = not self.de.getOnlyShowIn()
+        noshow = False
+        force = False
+        for i in self.de.getOnlyShowIn():
+            if i in envs: force = True
+        for i in self.de.getNotShowIn():
+            if i in envs: noshow = True
+
+        if verbose:
+            if not default and not force:
+                s = ""
+                for i in self.de.getOnlyShowIn():
+                    if s: s += ", "
+                    s += i
+                self.alert("Excluded by: OnlyShowIn (" + s + ")")
+            if default and noshow and not force:
+                s = ""
+                for i in self.de.getOnlyShowIn():
+                    if s: s += ", "
+                    s += i
+                self.alert("Excluded by: NotShowIn (" + s + ")")
+        return (default and not noshow) or force
+
+    def shouldRun(self, envs, verbose=False):
+        if not self.de.getExec():
+            if verbose: self.alert("Excluded by: Missing Exec field")
+            return False
+        if self.de.getHidden():
+            if verbose: self.alert("Excluded by: Hidden")
+            return False
+        if self.de.getTryExec():
+            if not self.findFile(self.de.getTryExec(), os.getenv("PATH"),
+                                 self.isexecfile):
+                if verbose: self.alert("Excluded by: TryExec (" +
+                                          self.de.getTryExec() + ")")
+                return False
+        if not self.showInEnvironment(envs, verbose):
+            return False
+        return True
+
+    def list(self, envs):
+        running = False
+        if self.shouldRun(envs):
+            print "[*] " + self.de.getName()
+        else:
+            print "[ ] " + self.de.getName()
+        self.alert("File: " + self.path, info=True)
+        if self.de.getExec():
+            self.alert("Executes: " + self.de.getExec(), info=True)
+        self.shouldRun(envs, True)
+        print
+
+    def run(self, envs):
+        here = os.getcwd()
+        if self.de.getPath():
+            os.chdir(self.de.getPath())
+        if self.shouldRun(envs):
+            args = ["/bin/sh", "-c", "exec " + self.de.getExec()]
+            os.spawnv(os.P_NOWAIT, args[0], args);
+        os.chdir(here)
+
+def show_help():
+    print "Usage:", ME, "[OPTION]... [ENVIRONMENT]..."
+    print
+    print "This tool will run xdg autostart .desktop files"
+    print
+    print "OPTIONS"
+    print "  --list        Show a list of the files which would be run"
+    print "                Files which would be run are marked with an asterix"
+    print "                symbol [*].  For files which would not be run,"
+    print "                information is given for why they are excluded"
+    print "  --help        Show this help and exit"
+    print "  --version     Show version and copyright information"
+    print
+    print "ENVIRONMENT specifies a list of environments for which to run autostart"
+    print "applications for.  If none are specified, only applications which do not "
+    print "limit themselves to certain environments will be run."
+    print
+    print "ENVIRONMENT can be one or more of:"
+    print "  GNOME         Gnome Desktop"
+    print "  KDE           KDE Desktop"
+    print "  ROX           ROX Desktop"
+    print "  XFCE          XFCE Desktop"
+    print "  Old           Legacy systems"
+    print
+
+def show_version():
+    print ME, VERSION
+    print "Copyright (c) 2008        Dana Jansens"
+    print
+
+if __name__ == "__main__":
+        sys.exit(main())
This page took 0.0439850000000001 seconds and 4 git commands to generate.