Giter Club home page Giter Club logo

dmenu-extended's Issues

Can't access folders/files with characters like "ç, ã, é"

If I create a folder like "test" and add a file "test.pdf", the file is indexed and that's the normal behavior.
But if I create "test/testç.pdf", the file isn't indexed nor it appear on any cache file at .config/dmenu-extended/cache.
Also if I create "testç" and put the files "test.pdf" and "exampleç.pdf", even if the folder is recorded at dmenuExtended_folders.txt, the files are not.
Anyway I hope I'm being clear because english is not my mother language.
Thanks in advance!
PS: I use utf-8 scheme.

URL's are being execute twice.

There is no sys.exit() after the line handling the URL's in run() (line 1156), so URL's are being processed by the following block starting at line 1213, resulting in the URL's being handled twice.

Aliasing not working

I put "~/.bashrc" as my path_aliasFile and it isn't registering my aliases. I have alias_applications set to true. What more is there to do?

{ "alias_applications": true, "alias_display_format": "{name}", "exclude_items": [], "filebrowser": "xdg-open", "fileopener": "xdg-open", "filter_binaries": true, "follow_symlinks": false, "frequently_used": 0, "ignore_folders": [], "include_applications": true, "include_binaries": true, "include_hidden_files": false, "include_hidden_folders": false, "include_items": [], "indicator_alias": "#", "indicator_edit": "*", "indicator_submenu": "->", "menu": "dmenu", "menu_arguments": [ "-b", "-i", "-nf", "#888888", "-nb", "#1D1F21", "-sf", "#ffffff", "-sb", "#1D1F21", "-fn", "terminus", "-l", "20" ], "path_aliasFile": "~/.bashrc", "path_shellCommand": "~/.dmenuEextended_shellCommand.sh", "prompt": "Open:", "scan_hidden_folders": false, "terminal": "xterm", "valid_extensions": [ "py", "svg", "pdf", "txt", "png", "jpg", "gif", "php", "tex", "odf", "ods", "avi", "mpg", "mp3", "lyx", "bib", "iso", "ps", "zip", "xcf", "doc", "docxxls", "xlsx", "md", "html", "sublime-project" ], "watch_folders": [ "~/" ], "webbrowser": "xdg-open" }

This is my dmenuExtended_preferences.txt. Should I change something within? Should I uninstall the old dmenu? All help is appreciated. Thanks.

Changing window's size and exit key

Hello,

I recently started using dmenu-extended and I'm quite pleased with it! I've two questions however:

  • Is it possible to change the size of the window? By default, it seems to be half the vertical size of the screen. I would like to change this. Is it possible? (I find it too big);

  • Is it possible to make it so the shortcut to open dmenu-extended, closes it if it's already opened? I don't like having to type esc to close it;

  • Is it possible to change the position of the window? For example, change it to the top (instead of bottom), or to the mid of the screen..

Also, I find that there's slight delay in opening dmenu-extended after pressing the shortcut. It's a very small delay, but it's noticeable. Anything I can do to improve opening time?

Sorry for nitpicking! Dmenu-extended is awesome, thank you!

EDIT: I've managed to change the verical size of the window by changing one of the "menu-arguments".

OSError: [Errno 2] No such file or directory on Ubuntu

Running dmenu-extended, latest git pull, on awesome in ubuntu 17.04

Getting this error.

$ dmenu_extended_run --debug
Debugging enabled
Launch arguments: []
Frequently used items cache does not exist, will return nothing
Opening cache at /home/user/.config/dmenu-extended/cache/dmenuExtended_plugins.txt
Opening cache at /home/user/.config/dmenu-extended/cache/dmenuExtended_all.txt
First menu closed with user input: Chromium Web Browser (chromium-browser)
Loading plugins
This command is not related to a plugin
Converting 'Chromium Web Browser (chromium-browser)' into its aliased command
Chromium Web Browser (chromium-browser)
No suitable candidate was found
Executing user input as a command
Executing: Chromium Web Browser (chromium-browser)
Command converted into:
[u'Chromium', u'Web', u'Browser', u'(chromium-browser)']
Traceback (most recent call last):
  File "/usr/local/bin/dmenu_extended_run", line 7, in <module>
    dmenu_extended.run(*sys.argv)
  File "/usr/local/lib/python2.7/dist-packages/dmenu_extended.py", line 1844, in run
    handle_command(d, out)
  File "/usr/local/lib/python2.7/dist-packages/dmenu_extended.py", line 1506, in handle_command
    d.execute(out)
  File "/usr/local/lib/python2.7/dist-packages/dmenu_extended.py", line 649, in execute
    return subprocess.call(command)
  File "/usr/lib/python2.7/subprocess.py", line 168, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib/python2.7/subprocess.py", line 390, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1024, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

systemd service units and timer

@markjones112358
Are you sure your service units and timer are written correctly? They do not seem to work for me.

On my system, path to file is /usr/bin/dmenu_extended_cache_build, so I tried to use the system service unit, with systemsctl --user start update-dmenu-extended-db.system.service

Fails with various iterations of: Invalid user/group name or numeric ID:

Timer will not load since unit does not.

Are these working for you?

Edit: removing the line "User=%i" seems to do the trick (for the user unit).
I am either using the systemd-install.sh script wrong or it fails to insert the user name instead of %i in the unit file.

(In addition, I am not sure specifying the user is necessary in this case.)

But will look further into it and probably write my own service and timer files.

Spotify alias not working

Hello,

I just changed up my regular ol' dmenu to dmenu-extended, and I'm really liking it thus far!

One issue that I'm having is that my Spotify alias in my ~/.bashrc isn't being triggered for some reason. The alias itself is: alias spotify_hidpi='/usr/bin/spotify --force-device-scale-factor=2'

I've modified dmenuExtended_preferences.txt to point to my bashrc, and after updating the cache, the command spotify_hidpi does appear. However, nothing happens when I choose to run it - any idea why this might be happening?

FWIW, running spotify_hidpi in my gnome-terminal works as expected.

Thanks!

Rofi integration?

Just tried calling dmenu_extended.py as rofi mode (rofi -show dm -modi dm:~/git/dmenu_extended/dmenu_extended.py), which returns the following error: from: can't read /var/mail/__future__
Any ideas?

Unicode paths are not handled correctly

After waiting for sometime for the cache to be built, I get the following error :

Traceback (most recent call last):
  File "/usr/local/bin/dmenu_extended_cache_build", line 6, in <module>
    dmenu_extended.dmenu().cache_build()
  File "/usr/local/lib/python2.7/dist-packages/dmenu_extended.py", line 938, in cache_build
    for root, dirs , files in os.walk(foo, followlinks=follow_symlinks):
  File "/usr/lib/python2.7/os.py", line 296, in walk
    for x in walk(new_path, topdown, onerror, followlinks):
  File "/usr/lib/python2.7/os.py", line 286, in walk
    if isdir(join(top, name)):
  File "/usr/lib/python2.7/posixpath.py", line 73, in join
    path += '/' + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xb4 in position 1: ordinal not in range(128)

It seems it is a known issue with os.walk : see this stackoverflow question : http://stackoverflow.com/questions/21772271/unicodedecodeerror-when-performing-os-walk

You can reproduce the issue locally by running the following in your shell:

touch  "$(echo -e ".abc\x8b\x8bThis is a bad filename")"
dmenu_extended_cache_build

'desktop' entries do not open any more

I was running 56b9f6f for some time now and recently started pulling the new versions. I noticed desktop entries were not working any more; they just do not open.

I did a bisect, which points to 5aeafa3 :

5aeafa3f9f3cb4665a23d56b2a908afca1c48ef2 is the first bad commit
commit 5aeafa3f9f3cb4665a23d56b2a908afca1c48ef2
Author: Mark H. Jones <[email protected]>
Date:   Mon Jun 6 17:36:00 2016 +1200

    Rewrote adding and removing entry logic

:100755 100755 c401e08fe3cb609b6a61b9a86d0273b076258d17 4aac3bae58feb52f10c38225575e9ffe35c1e8b4 M  dmenu_extended.py

Most used at top

First of all, thank you for dmenu-extended it's awesome and very useful.

I was wondering if you'd consider pushing the most used commands at the top, even and especially when searching for a program, no matter how many times I pick it, the next time I search for it I will still have to go down a few places or write its more letter of its name.

Thanks

Directly calling cache_build leaves global variable d uninitialized

When following the instruction to create a python script to update the cache file:

#! /bin/python
import dmenu_extended
dmenu_extended.dmenu().cache_build()

Python returns error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/user/Development/dmenu-extended/dmenu_extended.py", line 952, in cache_build
    plugins = self.plugins_available()
  File "/home/user/Development/dmenu-extended/dmenu_extended.py", line 743, in plugins_available
    plugins = self.get_plugins(True)
  File "/home/user/Development/dmenu-extended/dmenu_extended.py", line 284, in get_plugins
    self.plugins_loaded = load_plugins(self.debug)
  File "/home/user/Development/dmenu-extended/dmenu_extended.py", line 195, in load_plugins
    plugins_loaded[0]['plugin'].launch_args = d.launch_args
AttributeError: 'NoneType' object has no attribute 'launch_args'

This is due to the fact that, without calling run(), the global variable d is uninitialized. I made a quick change to get around this issue, and it seems to be working so far, however I'm not sure if this'll not create any problems.

Why is the Preferences a .txt if it's a json

dmenuExtended_preferences.txt is a json valid file, why does it have a .txt extension? also there are lot's of whitespace.

Thank you for this project, I'm loving it! :D I would also like to know if there is a guide to contribute plugins

Only search .desktop files?

I would like to only be able to search only .desktop files, but it seems that they do not pick up properly. For instance, I have a google-chrome.desktop file and I set the flag in the desktop file to be --force-device-scale-factor=1.3(for my monitor). See here: https://major.io/2015/06/10/chrome-43-stuck-in-hidpi-mode/

If I launch this through xdg or through another window manager it picks up the settings, but it does not pick up the setting in dmenu extended.

cache takes very long time with many dotfiles

I have a very huge amount of hidden files : about 400 000.

Caching the files takes an infinite time to complete (it is running for more than an hour now)

If I change the code like this by adding a print(root)

        for watchdir in watch_folders:
            for root, dirs , files in os.walk(watchdir, followlinks=follow_symlinks):
                dirs[:] = [d for d in dirs if os.path.join(root,d) not in ignore_folders]
                print(root)
                if self.prefs['scan_hidden_folders'] or root.find('/.')  == -1:
                    for name in files:
                        if self.prefs['include_hidden_files'] or name.startswith('.') == False:
                            if valid_extensions == True or os.path.splitext(name)[1].lower() in valid_extensions:
                                filenames.append(os.path.join(root,name))
                    for name in dirs:
                        if self.prefs['include_hidden_folders'] or name.startswith('.') == False:
                            foldernames.append(os.path.join(root,name) + '/')

I see that all files are parsed recursively.
I have 'scan_hidden_folders' set to false.

I think the problem comes from the fact that os.walk is recursive, so it can be very slow since it will open all files, even if they are hidden.

For example, it will open

/home/edgar/Documents/articles/.git/objects/3b
/home/edgar/Documents/articles/.git/objects/4a
/home/edgar/Documents/articles/.git/objects/4b
/home/edgar/Documents/articles/.git/objects/4c
/home/edgar/Documents/articles/.git/objects/4d
/home/edgar/Documents/articles/.git/objects/4e
/home/edgar/Documents/articles/.git/objects/4f

I think by using os.listdir(path) and doing the recursion inside python, we would get a huge performance benefit.

Change Tab behaviour to jump to next hit instead of completion

Hi,

Currently, dmenu_extended applies the arrow keys to move to the next/previous completion after typing in part of the search term.

As a heavy vim user, this behaviour feels odd to me. My fingers are moved way too far from the middle keyboard row.

Is it possible to move to the next item with Tab instead of the arrow keys?

Background transparency

Hi!

Is it possible to use background transparency? If not, could this be implemented? Thanks in advance!

Running bash scripts with ";;" gives an error.

For example, I'm trying to run a script /colors.sh. I first add it to the cache and then attempt to run with "/colors.sh;;" from within dmenu_extended. This gives me the output

/home/username/.dmenuEextended_shellCommand.sh: line 2: -cd: command not found


Press enter to exit

The file dmenuEextended_shellCommand.sh contains

#! /bin/bash
-cd /home/username/colors.sh;
echo "

Press enter to exit";read var;

If I remove the "-cd " from line 1257 it seems to work fine.

As a side note dmenuEextended_shellCommand.sh was probably meant to be dmenuExtended_shellCommand.sh.

Folders with colon character

Folders containing the colon character (':') are not properly opened. Running it from a terminal throws an error message:

/home/user/Documents/Area: subject/
/home/user/Documents/Area: subject/
Traceback (most recent call last):
  File "dmenu_extended_run", line 7, in <module>
    dmenu_extended.run(*sys.argv)
  File "/home/user/bin/dmenu_extended.py", line 1850, in run
    d.execute(command)
  File "/home/user/bin/dmenu_extended.py", line 664, in execute
    return subprocess.call(command)
  File "/usr/lib/python2.7/subprocess.py", line 523, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1343, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

Thank you for your work!

Directly search the internet

Hello,
Its great to see the new form of dmenu with added plugins. I really apreciate your work and I have been using it for my day to day life.
I was wonder if it is possible to directly search the internet with keybind. Currently, I have to run dmenu_extended_run and choose the third option with down key(which is far away) , select google and then search .. It will be nice if we can search directly with keybind like:

$ dmenu_extended_run --search google

Well, it will be really nice if you add the search result too in list format.

Thanking You
Subash

dmenu-extended doesn't honor Terminal=true in .desktop files?

Hello,
I have run into an issue.

Take the following .desktop file as an example

[Desktop Entry]
Type=Application
Name=ranger
Terminal=true
Exec=ranger
MimeType=inode/directory;

In a terminal, xdg-open ~ correctly opens ranger in my home directory.
If I run dmenu-extended from terminal (dmenu_extended_run) and pick a directory (say ~/Downloads), it is correctly opened in ranger in the same terminal where I ran dmenu_extended_run.
If i run dmenu-extended through an hotkey in i3, then this kind of programs that should run in terminal actually run in my login shell outside the X session, and I have to exit i3 to see them.

A small fix, however, makes it work as expected:

(In the desktop file)
Exec=urxvt -e ranger

Now, obviously, this isn't the correct way to fix it.

I have tested everything with vim instead of ranger, text files instead of directories, and it's the same.

EDIT: I am beginning to think that maybe the issue is not in dmenu-extended, but in xdg-open. Any thoughts?

Problems with umlauts/other special characters

dmenu-extended correctly indexes files which names contain characters like ö, ä, ü, §, but seems to incorrectly pass those paths to xdg-open, so nothing happens when opening these files via dmenu-extended.

Foreign characters in different encoding than utf-8 cause it to crash

When trying to add files which contain foreign characters in different encoding than utf-8, dmenu-extended simply crashes.
After some debugging I managed to identify the issue and remove the files.
It would be nice if dmenu-extended would ignore the files and print a warning, or at least print why and on which file it crashed.
Example of files which will cause it to crash:
http://www.serialzone.cz/download/titulky-serie/?sid=54&serie=2

Also including program output

Traceback (most recent call last):
File "/usr/bin/dmenu_extended_run", line 11, in
dmenu_extended.run(debug)
File "/usr/lib/python3.4/site-packages/dmenu_extended.py", line 1084, in run
cache = d.cache_load()
File "/usr/lib/python3.4/site-packages/dmenu_extended.py", line 501, in cache_load
if self.cache_regenerate() == False:
File "/usr/lib/python3.4/site-packages/dmenu_extended.py", line 468, in cache_regenerate
cache = self.cache_build()
File "/usr/lib/python3.4/site-packages/dmenu_extended.py", line 788, in cache_build
self.cache_save(foldernames, file_cache_folders)
File "/usr/lib/python3.4/site-packages/dmenu_extended.py", line 478, in cache_save
f.write(item+"\n")
File "/usr/lib/python3.4/codecs.py", line 711, in write
return self.writer.write(data)
File "/usr/lib/python3.4/codecs.py", line 368, in write
data, consumed = self.encode(object, self.errors)
UnicodeEncodeError: 'utf-8' codec can't encode character '\udca1' in position 58: surrogates not allowed

Can't build cache

python -c "import dmenu_extended

dmenu_extended.dmenu().cache_build()"
Setting up dmenu-extended prefs files...
Plugins directory exists - skipped
Cache directory exists - skipped
prefs directory exists - skipped
Existing preferences file found, will not overwrite.
Traceback (most recent call last):
File "", line 2, in
File "/usr/lib/python3.5/site-packages/dmenu_extended.py", line 668, in cache_build
applications = self.scan_applications()
File "/usr/lib/python3.5/site-packages/dmenu_extended.py", line 555, in scan_applications
for line in f.readlines():
File "/usr/lib/python3.5/codecs.py", line 706, in readlines
return self.reader.readlines(sizehint)
File "/usr/lib/python3.5/codecs.py", line 615, in readlines
data = self.read()
File "/usr/lib/python3.5/codecs.py", line 501, in read
newchars, decodedbytes = self.decode(data, self.errors)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd9 in position 22: invalid continuation byte

Donations?

Is there a way I can donate to this program? If so, please let me know here or through private message. I use this program everyday and it sames me an immense amount of time.

For example, I no longer have to use bash scripts for example to do basic things like launch a bunch programs. I just add them as aliases and it works great! I would love to donate.

Ability to view (Aliased) Applications

I was comparing things and I noticed few missing Applications only to see that it's there (in binary) and it wasn't what I was expecting. I was wondering if that was expected behavior. I was expecting to see "minecraft" and "Minecraft (minecraft)"

If you have an (aliased) application that execs the same binary. (As the binary itself would...). Both of them will not be in the list ; only the binary will be.

For an exercise.... If you toggled "filter_binaries": true, you're expected to see (aliased) applications. What happened here is that we're seeing a mixed result -- Both (aliased) applications and certain binaries. I think it might be the unintended behavior of omitting / merging two things in your code to display less/repetative results.

History feature

In many line based programs (readline mostly), you can navigate the history of previous commands with Ctrl-p and Ctrl-n (or the arrow keys)

In dmenu-extended, I sometimes want to reexecute the same command that I executed last time.

Since arrow keys and Ctrl-p/Ctrl-n do the same thing (navigate between the choices), I propose that we use arrow keys for choice navigation and Ctrl-p/Ctrl-n for history navigation.

Would you be interested in implementing that ? If you don't have time to implement it, would you be accepting a merge request for that change. If yes, can you please pinpoint a bit where this change should be done ?

Thanks in advance !

Ability to view/index hidden files

I discovered this gem today. I loved it. I wanted to know how I can add hidden directories / files to the indexing. That way, I can open the configuration files (with preferred/different editor) sometimes without using the terminal. Can we support this option? I do want the option to view/index the entire home directory if that's possible.

Execute command in custom environment

I can't get my head around a way to launch a command through dmenu_extended using a specific environment variable like this: env $VAR= command. Neither defining an alias nor a wrapper script would work with dmenu. Any tips?

Why are you using /tmp/dmenuEextended_shellCommand.sh?

Hi,

So, I've seen that you are using /tmp/dmenuEextended_shellCommand.sh to execute commands with the terminal.
However, atleast on my system, it doesn't work :
I have no permission to execute that script, and any commands with ; or ;; at the end simply fail to execute.

Wouldn't it be easier to use ~/.dmenuExtended_Command.sh or something?

ls -l gives me that:
-rwxr-xr-x 1 yan yan 57 27.02.2015 00:19 dmenuEextended_shellCommand.sh*

Be able to use shell aliases

Hi,

Thank you for dmenu-extended, I love it.

Would it be possible to use shell aliases defined in a ~/.zsh_aliases file for dmenu-extended? I use zsh myself but bash would be fine to.

Best regards,
Markus Lindberg.

Can't build cache, utf-8 error

python3 -c "import dmenu_extended
  dmenu_extended.dmenu().cache_build()"
Setting up dmenu-extended prefs files...
Plugins directory exists - skipped
Cache directory exists - skipped
prefs directory exists - skipped
Existing preferences file found, will not overwrite.
Traceback (most recent call last):
  File "<string>", line 2, in <module>
  File "/usr/lib/python3.5/site-packages/dmenu_extended.py", line 850, in cache_build
    self.cache_save(foldernames, file_cache_folders)
  File "/usr/lib/python3.5/site-packages/dmenu_extended.py", line 504, in cache_save
    f.write(item+"\n")
  File "/usr/lib/python3.5/codecs.py", line 718, in write
    return self.writer.write(data)
  File "/usr/lib/python3.5/codecs.py", line 376, in write
    data, consumed = self.encode(object, self.errors)
UnicodeEncodeError: 'utf-8' codec can't encode character '\udcbf' in position 32: surrogates not allowed

Simple workaround is to catch exceptions in f.write(item+"\n"), but maybe it should be fixed anywhere else?

Feature Request: Open specific file extension with a specific program

Hi

Your program has helped me a lot and I use it every day. I'm really thankful for that. I use ncmpcpp as the music player and vlc as the video player on my PC. Right now if I search for a song it will be played with vlc (I set "fileopener": "vlc") It would be great if we could open specific file extensions with specific programs. Perhaps you could add an option to do that in the config file ?

Ability to Alias "Internet Search?"

I find that I often search using the Internet Search plugin, but I would ideally like to just type something like "g"(for google) and have it pop up. Is this possible currently? This may also have to do with the fact that things most used aren't near the top. I think a small cache of 100 items or so may be beneficial?

ascii UnicodeDecodeError

First time executing dmenu_extended_run, I get:

Traceback (most recent call last):
  File "/usr/local/bin/dmenu_extended_run", line 11, in <module>
    dmenu_extended.run(debug)
  File "/usr/local/lib/python2.7/dist-packages/dmenu_extended.py", line 1120, in run
    cache = d.cache_load()
  File "/usr/local/lib/python2.7/dist-packages/dmenu_extended.py", line 510, in cache_load
    if self.cache_regenerate() == False:
  File "/usr/local/lib/python2.7/dist-packages/dmenu_extended.py", line 477, in cache_regenerate
    cache = self.cache_build()
  File "/usr/local/lib/python2.7/dist-packages/dmenu_extended.py", line 757, in cache_build
    for root, dirs , files in os.walk(watchdir, followlinks=follow_symlinks):
  File "/usr/lib/python2.7/os.py", line 296, in walk
    for x in walk(new_path, topdown, onerror, followlinks):
  File "/usr/lib/python2.7/os.py", line 296, in walk
    for x in walk(new_path, topdown, onerror, followlinks):
  File "/usr/lib/python2.7/os.py", line 296, in walk
    for x in walk(new_path, topdown, onerror, followlinks):
  File "/usr/lib/python2.7/os.py", line 296, in walk
    for x in walk(new_path, topdown, onerror, followlinks):
  File "/usr/lib/python2.7/os.py", line 296, in walk
    for x in walk(new_path, topdown, onerror, followlinks):
  File "/usr/lib/python2.7/os.py", line 296, in walk
    for x in walk(new_path, topdown, onerror, followlinks):
  File "/usr/lib/python2.7/os.py", line 296, in walk
    for x in walk(new_path, topdown, onerror, followlinks):
  File "/usr/lib/python2.7/os.py", line 286, in walk
    if isdir(join(top, name)):
  File "/usr/lib/python2.7/posixpath.py", line 73, in join
    path += '/' + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xb3 in position 1: ordinal not in range(128)

dmenu-extended and rofi

@markjones112358

Is it possible to use dmenu-extended with rofi--but setting the number of lines somehow in the "menu_arguments" inside dmenuExtended_preferences.txt ?

I tried using this: "-theme-str '#listview { lines:20;}' -show drun" for example. This works on the cli but not as an argument inside the json file.

I also tried the simple "-lines 20" inside of "menu_arguments" either before or after "-dmenu" to no avail.

This feature would be helpful as I already run rofi as window switcher but only want just a few lines in that case.

OTOH, when using dmenu-extended, I want 20 lines or more (useful when scrolling through files). I have not found a way to have settings for opening rofi with a different number of lines (when using dmenu-extended) yet but it should be possible.

FileNotFoundError on startup

Hi! I tried to start it, but an exception is thrown, I haven't had time to get into the code to check what could it be.

1424458230

I used the package in aur and master from this repo.

Thank you!

Fonts and size

With the latest commit dmenu doesn't seem to honor the value given in the config anymore, which worked fine before. I have terminus set as font and 12 as font size and neither font nor size seem to change from a set standard value no matter what I chose. It shows a different font and the a much too big size when I run dmenu-extended. I tried directly editing the value in the "dmenu_extended.py" file but that didn't do the trick either.

Store plugins in a repo + PackageManager patch

Storing the dmenu-extended plugins in gist seems less preferable than having them in a git repository, possibly even this repository.

On a related note, I made a slight change to the systemPackageManager plugin to enable refreshing the cache from a script without dmenu showing, diff viewable here:
https://gist.github.com/jebaum/ac6272c074a3afb37935/revisions

I can't send a pull request for gists though as far as I know.

Anyway, this mirrors the implementation of cache_regenerate in dmenu_extended.py, and allows for this script to refresh all caches (personally I have it as a cron job) in the background:

#!/usr/bin/python

import dmenu_extended
import os
import imp

dmenu_extended_pm_path = os.path.expanduser('~') + '/.config/dmenu-extended/plugins/dmenu_extended_systemPackageManager.py'

dmenu_extended_systemPackageManager = imp.load_source('dmenu_extended_systemPackageManager ', dmenu_extended_pm_path)

p = dmenu_extended_systemPackageManager.extension()
p.build_package_cache(message=False)

d = dmenu_extended.extension()
d.cache_regenerate(message=False)

XDG Application Searching

Hello!

First of all: thank you for this brilliant project, it's just what I was looking for! It's elegant, powerful, and easy to use.

There is however one small problem for me. Because the list programs are determined by examining the binaries, some things which I'd like to launch are not immediately accessible (like LibreOffice, and Chrome for me (it lives inside a chroot)). Of course, one can easily manually add an entry to the cache, but this sort of thing can be done automatically if the application files (i.e. the .desktop files) are also scanned.

As it happens, I have already written the code for such a thing. I was in the process of making something similar to dmenu-extended (albeit a lot less powerful); you can find it here (it's not finished). I would very much like to add in this functionality and submit it as a pull request, but I feel I should consult with about one thing first: it requires the (non-standard-library) xdg python module.

It makes sense to me that you'd probably want to keep the number of dependencies to a minimum, so you might not think that it's worth requiring this extra module for the benefit it gives. Now, unfortunately the xdg module is licensed under the GNU license (see the repo here), so I can't just copy in the relevant bits of code (though, they aren't that complex, so it shouldn't be too much trouble to write them over again).

I'll probably fork the project and add my bits anyway, but I was wondering if this is something you'd like me to pull-request you?

(By the way, in the project I was working on, I also had a feature which allowed you to do 'acronym searching'; so "low" would match Libre Office Writer, for example. I would be very happy to code this in dmenu-extended, if you want.)

Thanks again!

Sudo plugin behavior

(running current GIT version under up-to-date Arch linux) While the instructions for using password helper work perfectly, using the Sudo plugin has an error immediately after typing Enter after typing the desired command target for 'sudo', e.g. 1) launch dmenu_extended_run, 2) choose the Sudo plugin, 3) type a program like 'gparted' which requires su 4) result: dmenu window closes.

Launching dmenu_extended_run in a terminal for the above yields:

`Traceback (most recent call last):

File "/usr/bin/dmenu_extended_run", line 7, in
dmenu_extended.run(*sys.argv)
File "/usr/lib/python3.6/site-packages/dmenu_extended.py", line 1546, in run
plugin_hook[0].run(out[len(plugin_hook[1]):].strip())
File "/home/paul/.config/dmenu-extended/plugins/plugin_sudo.py", line 63, in run
dmenu_extended.handle_command(self, item)
File "/usr/lib/python3.6/site-packages/dmenu_extended.py", line 1509, in handle_command
d.execute(out)
File "/usr/lib/python3.6/site-packages/dmenu_extended.py", line 649, in execute
return subprocess.call(command)
File "/usr/lib/python3.6/subprocess.py", line 267, in call
with Popen(*popenargs, **kwargs) as p:
File "/usr/lib/python3.6/subprocess.py", line 707, in init
restore_signals, start_new_session)
File "/usr/lib/python3.6/subprocess.py", line 1333, in _execute_child
raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'SUDO_ASKPASS="/home/paul/.config/dmenu-extended/plugins/plugin_sudo.py" sudo -A '`

I don't have a good enough grasp of the py code to understand the cause of the error: the plugin_sudo.py file certainly exists and has +x permissions. Any ideas?

How do I create plugins?

Hello,

Where can I find information on creating plugins?
I cant find the documentation anywhere.

Thanks

Aliases incorrectly attach themselves to directories

When I try to open a file in my ~/Dropbox directory, (anywhere under it, really) dmenu-extended opens the dropbox program. When I try to open a video in my ~/Videos directory, dmenu-extended opens the program called Videos (via the desktop file which calls it Videos in GNOME but is really Totem). Removing these aliases from the lookup table fixes it temporarily, but then the problem reappears each time the cache is rebuilt.

Bug in Proper Mapping of Aliases

Hi Mark,
I believe I found a bug in registering the mapping of aliases in the aliases_lookup.json, where if there is a formatting of alias (i.e. if I store them as # alias (command) ), then the alias wouldn't actually do anything. In fact, if I run it in a terminal, it would end with an error. I looked a bit further at the python code, and found the mistake (I think). The code for the function cache_build() (in the file dmenu_extended.py) has the lines

Lines 1062 - 1075

        if 'include_items' in self.prefs:
            include_items = []
            for item in self.prefs['include_items']:
                if type(item) == list:
                    if len(item) > 1:
                        aliased_items.append(self.format_alias(item[0], item[1]))
                        aliases.append([item[0], item[1]])
                    else:
                        if self.debug:
                            print("There are aliased items in the configuration with no command.")
                else:
                    include_items.append(item)
        else:
            include_items = []

I think the line aliases.append([item[0], item[1]]) should be replaced by aliases.append([self.format_alias(item[0], item[1]), item[1]])

I am not sure if the code you wrote is meant to be, and if I have done something wrong in setting up the aliases, but I still feel intuitively that the alias formatting should be in the code.

Btw, thanks for the great software. It's really great and makes a lot of things easier for many folks.

Have a nice day.

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.