GithubHelp home page GithubHelp logo

dex's People

Contributors

adrian-amaglio avatar edwardbetts avatar ilfat12 avatar j0j0 avatar jamessan avatar jceb avatar jcromero avatar kyrias avatar lasers avatar morxa avatar nbeaver avatar nk308 avatar otommod avatar stuaxo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dex's Issues

Symlinks are not inhibited

Since we have this feature #6 implemented empty files overwrite is allowed.

As suggested by systemd (man 5 tmpfiles.d), i tried this:

If the administrator wants to disable a configuration file supplied by the vendor the recommended way is to place a symlink to /dev/null in /etc/tmpfiles.d/ bearing the same file name.

So i tried this for desktop file too.
lrwxrwxrwx 1 seblu sebgp 9 2012-08-19 20:20 polkit-gnome-authentication-agent-1.desktop -> /dev/null

$ dex -ad -e Awesome
Executing command: /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1

As you can see, symlink to empty files doesn't work correctly.

Support exec key code field

Running desktop file which contains % in the exec key doesn't works correctly

$ dex -d /usr/share/applications/kde4/kwalletmanager.desktop
Executing command: kwalletmanager %u

As explain here: http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s06.html

A command line may contain at most one %f, %u, %F or %U field code. If the application should not open any file the %f, %u, %F and %U field codes must be removed from the command line and ignored.

So dex should remove %u in the above example.

Terminal=true is ignored, trivial fix

Trivial patch to fix this:

@@ -514,7 +514,7 @@ class Application(DesktopEntry):
 
 		if _exec:
 			path = self.Path
-			cmd = self._build_cmd(self.Exec)
+			cmd = self._build_cmd(self.Exec, self.Terminal)
 			if not cmd:
 				raise ApplicationExecException('Failed to build command string.')
 			if dryrun or verbose:

0.6

dex.version == 0.5, but it should be 0.6.

Running individual autostart entries via systemd

Hi! I've been thinking a bit about dex+systemd integration, and I've a kind-of-proposal, but would like to hear your thoughts before hacking into it. The idea is basically:

  • Ship a [email protected] file which has something like ExecStart=/usr/bin/dex run %I.
  • dex run $NAME will merely run $NAME.desktop. Just one entry though, not all of them.
  • A user can run systemctl --user enable [email protected].

Note that dex run is very very similar to dex -w, but takes only the basename instead of the full path (e.g.: caffeine instead of /etc/xdg/autostart/caffeine.desktop).

The end result is being able to run autostart-desktop entries with three benefits:

  • Entries must be explicitly enabled by the user (the XDG spec is highly flawed IMHO in that applications decide if they autostart, not the user).
  • They run as a systemd service, so get managed/restarted properly and all that. I personally have a statusbar indicator if any service transitions into a failed state.
  • There's no need to re-write autostart desktop entries as systemd-services

As a bonus point, something like dex enable $NAME that runs systemctl --user enable dex@$NAME.service might be interesting, though this is a bit systemd-centric, and, so far, it seems that dex is very systemd-agnostic, which is probably important for a lot of users.

What are you thoughts on this?

Syntax Error

Every time I run dex -a I get the following error (current git version)
File "/usr/bin/dex", line 124
except Exception, e:
^
SyntaxError: invalid syntax

Use of pyxdg

Why do you implement your own .desktop parser ? You should use pyxdg for that.

New release?

Hi, thanks for dex, it's amazing! Do you have any plans to make a new release? In distros, typically releases are packaged, and there are a few nice new features after the latest release. I can of course just package the latest commit, but it'd be nice to package it with a proper version number and know that the author considers it stable enough for a release.

Missed __version__ updates

Like with the 0.8.0 tag, __version__ wasn't updated for the 0.9.0 tag either. I would suggest writing a script for tagging releases that could update the __version__ as well so that this isn't forgotten.

Add a manpage

It would be nice if we can ship a manpage describing goals, option and commands of Dex.

Cheers,

Add a Makefile

Create a simple Makefile that installs the software in the appropriate locations.

[RFE] add ability to accept arguments which would be passed to command

Ideally I would love to pass args to dex , an example:

dex /usr/share/applications/google-chrome.desktop https://www.github.com
$ dex /usr/share/applications/google-chrome.desktop https://www.github.com
File does not exist: /https://www.github.com

Right now I created a wrapper but native support would be better:

_getpath() {
    _path=$1
    dex -dv ${_path} 2>/dev/null | \
        grep -Po '^Executing command: \K(.*)$'
}

_cmd=$(_getpath /usr/share/applications/google-chrome.desktop
exec ${_cmd} $@ &

Publish v0.10.1

The --property flag is very useful, but currently only available on the master branch of this repo.

Any interest in publishing an official v0.10.1 release with this feature?

Error with Chrome: Failed to connect to the bus: Could not parse server address: Unknown address type

Despite the error, Chrome seems to launch OK. However, about 1 of every 10 launches silently fail and I don't know if this is related.

Seems to be related to LD_LIBRARY_PATH. My LD_LIBRARY_PATH is not set. Is dex somehow setting an LD_LIBRARY_PATH before is launches a .desktop file?

https://unix.stackexchange.com/questions/423198/google-chrome-starts-but-fails-to-open-https-websites-this-site-can-t-be-reach/470360#470360

Full Error:

2031:2127:0125/112625.776052:ERROR:bus.cc(396)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
Gkr-Message: couldn't connect to dbus session bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[2031:2031:0125/112625.857561:ERROR:x11_input_method_context_impl_gtk.cc(144)] Not implemented reached in virtual void libgtkui::X11InputMethodContextImplGtk::SetSurroundingText(const base::string16 &, const gfx::Range &)

(google-chrome:2031): LIBDBUSMENU-GLIB-WARNING **: Unable to get session bus: Unknown or unsupported transport 'disabled' for address 'disabled:'

Fails to execute double quoted command

The desktop entry with following Exec= key

Exec=sh -c "notify-send date \\"\\$(date)\\""

fails to execute with error

Execution faild: test.desktop
'Exec value contains an unbalanced number of quote characters.'

Replacing double quotes with single fixes the error, but this entry is not valid.

Exec=sh -c 'notify-send date \\"\\$(date)\\"'

Version
dex 0.9.0
Python 3.11.3

support default values for XDG variables if they arnt set or empty

if i run dex -a -s $XDG_CONFIG_HOME/autostart nothing happens because XDG_CONFIG_HOME not set by default
But in XDG specs if some XDG enviroment variables not set it use default values

$XDG_CONFIG_HOME defines the base directory relative to which user-specific configuration files should be stored. If $XDG_CONFIG_HOME is either not set or empty, a default equal to $HOME/.config should be used.

same for other env's

`dex -c /etc/xdg/autostart/my-app.desktop` creates a `.desktop.desktop` file in ~/.config/autostart

❯ dex --version
dex 0.9.0

❯ uname --all
Linux thinkbook 6.4.8-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 03 Aug 2023 16:02:01 +0000 x86_64 GNU/Linux

I would expect the creation to keep the "single" .desktop file extension. Or maybe I am just using the command incorrectly?

This is what I run:

❯ dex -c /etc/xdg/autostart/welcome.desktop

~/.config/autostart
❯ exa --oneline --icons --classify
 albert.desktop -> /usr/share/applications/albert.desktop
 firewall-applet.desktop*
 picom.desktop
 redshift-gtk.desktop
 shutter.desktop
 wallpaper-once.desktop
 welcome.desktop.desktop

Support for the XDG_CURRENT_DESKTOP environment variable

First, thanks a lot for your work !

I was using two windows managers lately and I found out that dex was executing the same services on both.
After some investigations, I think it is because the XDG_CURRENT_DESKTOP variable is not used out of the box.
I am now using dex -e "$XDG_CURRENT_DESKTOP" for this to work.

As dex is relying on XDG variables, it would be coherent to read XDG_CURRENT_DESKTOP. Maybe as a default value for args.environment ?

What do you think about it ?

Optional Type and Name entry keys

Maybe it would sound silly. I've used to generate .desktop files from scripts the most minimal way:

 cat > ~/.config/autostart/foo.desktop << EOF
[Desktop Entry]
Exec=foo
EOF 

It have been working on all desktop environments so far (openbox via openbox-xdg-autostart, unity, mate, etc.)

I'm aware that Type and Name entry keys are required according to the freedesktop specification, but it looks like most of implementation consider them optional. It makes sense to be forgiving to user errors (like html5) or ignorance.

Patch to prevent dex running an app if it's already running

--- dex    2013-01-01 20:20:45.417859436 +1100
+++ /usr/bin/dex    2013-01-01 20:19:59.312435833 +1100
@@ -506,14 +506,18 @@
        """
        _exec = True
        _try = self.TryExec
+       execFile = os.path.split(self.Exec.split(' ')[0])[1]
        if _try and not (os.path.isabs(_try) and os.path.isfile(_try)) and not which(_try):
            _exec = False
 
        if _exec:
            path = self.Path
            cmd = self._build_cmd(self.Exec)
+           _pid = subprocess.getoutput('pgrep -u $USERNAME -x '+execFile) 
            if not cmd:
                raise ApplicationExecException('Failed to build command string.')
+           if _pid:
+               raise ApplicationExecException('Application already running with pid ' + _pid)
            if dryrun or verbose:
                if verbose:
                    print('Autostart file: %s' % self.filename)

dex traceback with service file

$ dex /usr/share/kde4/services/kwalletd.desktop
Traceback (most recent call last):
File "/usr/bin/dex", line 680, in
app = Application(f)
File "/usr/bin/dex", line 346, in init
if self.Type != 'Application':
File "/usr/bin/dex", line 257, in Type
return self.get_string('Type')
File "/usr/bin/dex", line 241, in get_string
return self._get_value(key, group=group, default=default)
File "/usr/bin/dex", line 215, in _get_value
self.load()
File "/usr/bin/dex", line 186, in load
raise DesktopEntryTypeException("'%s' is not a valid Desktop Entry because Type '%s' is unkown." % (self.filename, self.Type))
main.DesktopEntryTypeException: "'/usr/share/kde4/services/kwalletd.desktop' is not a valid Desktop Entry because Type 'Service' is unkown."

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/bin/dex", line 686, in
print("Execution faild: %s%s%s" % (app.filename, os.linesep, ex), file=sys.stderr)
NameError: name 'app' is not defined

Generate desktop files

Dex was created for environments without fancy tools to execute desktop entries. So far dex can only execute existing desktop files but it can not create them. It would be very handy to just point it to a file and create a new desktop entry for it. This would support the ~/.config/autostart mechanism for minimalistic environments even further.

Terminal=true issue.

Hello,

dex doesn't creating new terminal emulator window instead it's open app in current terminal.

If there is no terminal .desktop will started, but doesn't appear.

I doesn't have x-terminal-emulator, can you provide option for this?

Test failures on Python 3.6.5

dex --test
**********************************************************************
File "/usr/bin/dex", line 389, in __main__.Application._build_cmd
Failed example:
    Application._build_cmd('"gvim test" test2 "test \\" 3"')
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python3.6/doctest.py", line 1330, in __run
        compileflags, 1), test.globs)
      File "<doctest __main__.Application._build_cmd[4]>", line 1, in <module>
        Application._build_cmd('"gvim test" test2 "test \\" 3"')
      File "/usr/bin/dex", line 501, in _build_cmd
        raise ApplicationExecException('Exec value contains an unbalanced number of quote characters.')
    ApplicationExecException: 'Exec value contains an unbalanced number of quote characters.'
**********************************************************************
File "/usr/bin/dex", line 391, in __main__.Application._build_cmd
Failed example:
    Application._build_cmd(r'"test \\\\ \" moin" test')
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python3.6/doctest.py", line 1330, in __run
        compileflags, 1), test.globs)
      File "<doctest __main__.Application._build_cmd[5]>", line 1, in <module>
        Application._build_cmd(r'"test \\\\ \" moin" test')
      File "/usr/bin/dex", line 501, in _build_cmd
        raise ApplicationExecException('Exec value contains an unbalanced number of quote characters.')
    ApplicationExecException: 'Exec value contains an unbalanced number of quote characters.'
**********************************************************************
File "/usr/bin/dex", line 393, in __main__.Application._build_cmd
Failed example:
    Application._build_cmd(r'"gvim \\\\ \`test\$"')
Expected:
    ['gvim \\ `test$']
Got:
    ['gvim \\\\ \\`test\\$']
**********************************************************************
1 items had failures:
   3 of  25 in __main__.Application._build_cmd
***Test Failed*** 3 failures.

Support for type 'Link'

Add support for files like:

[Desktop Entry]
Icon=inode-directory
Name=myconfig
Type=Link
URL=file:///home/user/.config

and website links:

[Desktop Entry]
Icon=text-html
Name=archwiki
Type=Link
URL=https://archwiki.org

dex does not fully follow directory override

As explain here: http://standards.freedesktop.org/autostart-spec/autostart-spec-latest.html

If the same filename is located under multiple Autostart Directories only the file under the most important directory should be used.

currently dex doesn't allow disabling of .desktop file by creating an empty file in $XDG_CONFIG_HOME.

A workaround seems to work by adding the same desktop filename and add Hidden=true. But if Exec= is missing general file is launched.

Test failures

Tests fail in the latest release (v0.8.0) and the master branch:

$ make install PREFIX=$PWD/install && ./install/bin/dex --test -v
Trying:
    Application._build_cmd('gvim')
Expecting:
    ['gvim']
ok
Trying:
    Application._build_cmd('gvim test')
Expecting:
    ['gvim', 'test']
ok
Trying:
    Application._build_cmd('"gvim" test')
Expecting:
    ['gvim', 'test']
ok
Trying:
    Application._build_cmd('"gvim test"')
Expecting:
    ['gvim test']
ok
Trying:
    Application._build_cmd('"gvim test" test2 "test \\" 3"')
Expecting:
    ['gvim test', 'test2', 'test " 3']
**********************************************************************
File "./install/bin/dex", line 389, in __main__.Application._build_cmd
Failed example:
    Application._build_cmd('"gvim test" test2 "test \\" 3"')
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib64/python3.6/doctest.py", line 1330, in __run
        compileflags, 1), test.globs)
      File "<doctest __main__.Application._build_cmd[4]>", line 1, in <module>
        Application._build_cmd('"gvim test" test2 "test \\" 3"')
      File "./install/bin/dex", line 501, in _build_cmd
        raise ApplicationExecException('Exec value contains an unbalanced number of quote characters.')
    ApplicationExecException: 'Exec value contains an unbalanced number of quote characters.'
Trying:
    Application._build_cmd(r'"test \\\\ \" moin" test')
Expecting:
    ['test \\ " moin', 'test']
**********************************************************************
File "./install/bin/dex", line 391, in __main__.Application._build_cmd
Failed example:
    Application._build_cmd(r'"test \\\\ \" moin" test')
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib64/python3.6/doctest.py", line 1330, in __run
        compileflags, 1), test.globs)
      File "<doctest __main__.Application._build_cmd[5]>", line 1, in <module>
        Application._build_cmd(r'"test \\\\ \" moin" test')
      File "./install/bin/dex", line 501, in _build_cmd
        raise ApplicationExecException('Exec value contains an unbalanced number of quote characters.')
    ApplicationExecException: 'Exec value contains an unbalanced number of quote characters.'
Trying:
    Application._build_cmd(r'"gvim \\\\ \`test\$"')
Expecting:
    ['gvim \\ `test$']
**********************************************************************
File "./install/bin/dex", line 393, in __main__.Application._build_cmd
Failed example:
    Application._build_cmd(r'"gvim \\\\ \`test\$"')
Expected:
    ['gvim \\ `test$']
Got:
    ['gvim \\\\ \\`test\\$']
Trying:
    Application._build_cmd(r'vim ~/.vimrc', True)
Expecting:
    ['x-terminal-emulator', '-e', 'vim', '~/.vimrc']
ok
Trying:
    Application._build_cmd('vim ~/.vimrc', False)
Expecting:
    ['vim', '~/.vimrc']
ok
Trying:
    Application._build_cmd("vim '~/.vimrc test'", False)
Expecting:
    ['vim', '~/.vimrc test']
ok
Trying:
    Application._build_cmd('vim \'~/.vimrc " test\'', False)
Expecting:
    ['vim', '~/.vimrc " test']
ok
Trying:
    Application._build_cmd('sh -c \'vim ~/.vimrc " test\'', False)
Expecting:
    ['sh', '-c', 'vim ~/.vimrc " test']
ok
Trying:
    Application._build_cmd("sh -c 'vim ~/.vimrc \" test\"'", False)
Expecting:
    ['sh', '-c', 'vim ~/.vimrc " test"']
ok
Trying:
    Application._build_cmd("vim %u", False)
Expecting:
    ['vim']
ok
Trying:
    Application._build_cmd("vim ~/.vimrc %u", False)
Expecting:
    ['vim', '~/.vimrc']
ok
Trying:
    Application._build_cmd("vim '%u' ~/.vimrc", False)
Expecting:
    ['vim', '%u', '~/.vimrc']
ok
Trying:
    Application._build_cmd("vim %u ~/.vimrc", False)
Expecting:
    ['vim', '~/.vimrc']
ok
Trying:
    Application._build_cmd("vim /%u/.vimrc", False)
Expecting:
    ['vim', '//.vimrc']
ok
Trying:
    Application._build_cmd("vim %u/.vimrc", False)
Expecting:
    ['vim', '/.vimrc']
ok
Trying:
    Application._build_cmd("vim %U/.vimrc", False)
Expecting:
    ['vim', '/.vimrc']
ok
Trying:
    Application._build_cmd("vim /%U/.vimrc", False)
Expecting:
    ['vim', '//.vimrc']
ok
Trying:
    Application._build_cmd("vim %U .vimrc", False)
Expecting:
    ['vim', '.vimrc']
ok
Trying:
    Application._build_cmd("vim \\%u ~/.vimrc", False)
Expecting:
    ['vim', '%u', '~/.vimrc']
ok
Trying:
    Application._build_cmd("vim %x .vimrc", False)
Expecting:
    ['vim', '%x', '.vimrc']
ok
Trying:
    Application._build_cmd("vim %x/.vimrc", False)
Expecting:
    ['vim', '%x/.vimrc']
ok
59 items had no tests:
    __main__
    __main__.Application
    __main__.Application.__cmp__
    __main__.Application.__eq__
    __main__.Application.__init__
    __main__.Application.basename
    __main__.Application.execute
    __main__.ApplicationExecException
    __main__.ApplicationExecException.__init__
    __main__.ApplicationExecException.__str__
    __main__.AutostartFile
    __main__.AutostartFile.__init__
    __main__.DesktopEntry
    __main__.DesktopEntry.Categories
    __main__.DesktopEntry.Comment
    __main__.DesktopEntry.Exec
    __main__.DesktopEntry.GenericName
    __main__.DesktopEntry.Hidden
    __main__.DesktopEntry.Icon
    __main__.DesktopEntry.MimeType
    __main__.DesktopEntry.Name
    __main__.DesktopEntry.NoDisplay
    __main__.DesktopEntry.NotShowIn
    __main__.DesktopEntry.OnlyShowIn
    __main__.DesktopEntry.Path
    __main__.DesktopEntry.StartupNotify
    __main__.DesktopEntry.StartupWMClass
    __main__.DesktopEntry.Terminal
    __main__.DesktopEntry.TryExec
    __main__.DesktopEntry.Type
    __main__.DesktopEntry.URL
    __main__.DesktopEntry.Version
    __main__.DesktopEntry.__init__
    __main__.DesktopEntry.__lt__
    __main__.DesktopEntry.__str__
    __main__.DesktopEntry._get_value
    __main__.DesktopEntry.filename
    __main__.DesktopEntry.fromfile
    __main__.DesktopEntry.get_boolean
    __main__.DesktopEntry.get_list
    __main__.DesktopEntry.get_localestring
    __main__.DesktopEntry.get_numeric
    __main__.DesktopEntry.get_string
    __main__.DesktopEntry.get_strings
    __main__.DesktopEntry.load
    __main__.DesktopEntry.set_value
    __main__.DesktopEntry.write
    __main__.DesktopEntryTypeException
    __main__.DesktopEntryTypeException.__init__
    __main__.DesktopEntryTypeException.__str__
    __main__.EmptyAutostartFile
    __main__.EmptyAutostartFile.__init__
    __main__._autostart
    __main__._create
    __main__._run
    __main__._test
    __main__.get_autostart_directories
    __main__.get_autostart_files
    __main__.which
**********************************************************************
1 items had failures:
   3 of  25 in __main__.Application._build_cmd
25 tests in 60 items.
22 passed and 3 failed.
***Test Failed*** 3 failures.

This is on Fedora 27 with Python 3.6.4.

include into something else

Hi,

I'm just starting to use dex for awesome. It would be wonderful, if dex would somehow be available in a Debian package, but it may not warrant a package of its own.
Do you have an idea, where dex could fit into?

Thank you for dex!

Add example to associate dex with .Desktop files

Dex solved an issue I've had for the longest time -

  • Clicking on .desktop files opened them in gedit.

I made a desktop file that launches dex, and with that my desktop is useful again.

$ dex -c `which dex` -t ~/.local/share/applications/

or to install globally

$ sudo dex -c `which dex` -t /usr/local/share/applications/

This has been doing my head in for years (and others judging by bugzilla), so may be worth including in the README as an example.

Fails to compile on Ubuntu 14.04 with python-sphinx

Dex looks like a useful tool. Unfortunately...

$ make build
building the manpage in man/
Running Sphinx v1.2.2
building [man]: all manpages
updating environment: 1 added, 0 changed, 0 removed
reading sources... [100%] dex                                                                                                                                                                                                                  
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
writing... dex.1 { } 
Encoding error:
'ascii' codec can't decode byte 0xc3 in position 46: ordinal not in range(128)
$ cat /tmp/sphinx-err-6NSCzT.log
# Sphinx version: 1.2.2
# Python version: 2.7.6
# Docutils version: 0.11 release
# Jinja2 version: 2.7.2
# Loaded extensions:
#   sphinx.ext.oldcmarkup from /usr/lib/python2.7/dist-packages/sphinx/ext/oldcmarkup.pyc
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/sphinx/cmdline.py", line 254, in main
    app.build(force_all, filenames)
  File "/usr/lib/python2.7/dist-packages/sphinx/application.py", line 212, in build
    self.builder.build_update()
  File "/usr/lib/python2.7/dist-packages/sphinx/builders/__init__.py", line 209, in build_update
    self.build(['__all__'], to_build)
  File "/usr/lib/python2.7/dist-packages/sphinx/builders/__init__.py", line 276, in build
    self.write(docnames, list(updated_docnames), method)
  File "/usr/lib/python2.7/dist-packages/sphinx/builders/manpage.py", line 89, in write
    docwriter.write(largetree, destination)
  File "/usr/lib/python2.7/dist-packages/docutils/writers/__init__.py", line 80, in write
    self.translate()
  File "/usr/lib/python2.7/dist-packages/sphinx/writers/manpage.py", line 37, in translate
    self.output = visitor.astext()
  File "/usr/lib/python2.7/dist-packages/docutils/writers/manpage.py", line 272, in astext
    return ''.join(self.head + self.body + self.foot)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 46: ordinal not in range(128)

dex does not support wine path when in quotes

Hi,

thank you for your tool.
I've got an issue when running wine program because of \ within quotes
(the desktop file was created in gnome environment)

cat ~/.local/share/applications/Football.desktop
[Desktop Entry]
Name=Football Manager 2007
Exec=env WINEPREFIX="/home/user/.wine" wine "C:\\Program Files\\Sports Interactive\\Football Manager 2007\\fm.exe" --cache_skin=0 --windowed=true
Type=Application
StartupWMClass=Wine
Path=/home/user/.wine/dosdevices
Icon=93bd_game

I would propose the following change, do you agree?

git diff
diff --git a/dex b/dex
index 10b0424..a7657a2 100755
--- a/dex
+++ b/dex
@@ -477,8 +477,9 @@ class Application(DesktopEntry):
                                                continue

                                elif c == '\\':
-                                       in_esc = True
-                                       continue
+                                       if not in_quote:
+                                               in_esc = True
+                                               continue

                                elif c == '%' and not (in_quote or in_singlequote):
                                        in_fieldcode = True
~/dex/dex --dry-run ~/.local/share/applications/Football.desktop 
Changing directory to: /home/user/.wine/dosdevices
Executing command: env WINEPREFIX=/home/user/.wine wine C:\Program Files\Sports Interactive\Football Manager 2007\fm.exe --cache_skin=0 --windowed=true

and can run app without --dry-run ;-)

Regards,

Nicolas

Search desktop files ?

It would be great if dex provided a search function.

Currently I've got a couple of versions of TIlix installed on my computer, one works, one doesn't.
Would be great if I could use dex to tell me which desktop files had that app in them, and some other info.

Option to exclude specific desktop files

I use i3 as my main window manager and dex to autostart my desktop files. Most of these files are installed in /etc/xdg/autostart by their respective packages and everything works as expected.

Unfortunately, given the nature of Gnome & Friends, I also have to start all required daemons (in my case, cinnamon-settings-demon which is now split into a bunch of executables and desktop files). Dex does a great job with that, but:

  1. Some of the desktop files in /etc/xdg/autostart are also started by the session-manager (ex: pasystray). Those can be disabled on the cinnamon settings page (which controls the session daemon).

  2. Some of the desktop files are started by the display manager (and I honestly can't find out where, exactly). In my particular case, lightdm starts nm-applet and when I use dex -a, I end up with two nm-applets.

I'm willing to add a "--exclude" option to dex to treat those special cases. In my case, I could run with dex -a --exclude nm-applet to prevent nm-applet from starting up (despite -a).

Thoughts?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.