You are not logged in.
You have to rebuild mimeo against python 3.8 explicitly, or wait for xyne to rebuild if you got it from their repo. The latest release is 2019.07 so doesn't look deprecated to me
Last edited by V1del (2019-11-15 08:37:20)
Offline
Follow the discussion about rebuilding for Python 3.8 here. If it's not done by tomorrow night, nag me about it there
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
I realized xdg-open can "run" desktop files directly, and it seem like mimeo don't. This is what I got from running a desktop file generated by my web browser
WARNING: failed to determine command precursor for /home/tleydxdy/Desktop/some.desktop
WARNING: failed to determine command(s) for /home/tleydxdy/Desktop/some.desktop
is there some way to fix this?
Last edited by tleydxdy (2021-02-11 00:14:06)
Offline
I've added an "--exec" option to run the "Exec" field of desktop file arguments, e.g. "mimeo --exec vlc.desktop" will open vlc. If you want to make this the default behavior, create a custom desktop file and make it the default for the desktop MIME-type:
mimeo --create exec_desktop.desktop 'Desktop Runner' 'mimeo --exec %F' 'application/x-desktop' noterm
mimeo --prefer 'application/x-desktop' exec_desktop.desktop
edit: @all
While adding the above option I also addressed the numerous pylint errors and warnings. Almost all of the changes are transparent for users of the command-line utility but several keyword arguments have been renamed internally to conform to naming conventions. Anyone who uses the module directly will need to update their code.
The only command-line change is the fifth argument to the "--create" command, which should now be "term" for terminal applications and anything else for non-terminal applications.
The executable is also a proper python script too now instead of a bash wrapper.
Last edited by Xyne (2021-02-11 12:36:07)
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
much thanks!
Offline
the change is not quite working. firstly, /usr/bin/mimeo produces a error, changing the shebang line for /usr/bin/mimeo to the usual fixed it
#!/usr/bin/env python3
secondly, when I do
mimeo --exec the.desktop
it just exits and nothing happens, when I run the Exec= line in the file manually it launches correctly. This I have no clue, I tried to add some echo lines to the command it invokes but there still is no output
Offline
package ()
{
cd "$srcdir/$pkgname-$pkgver"
python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1
install -Dm755 "$pkgname" "$pkgdir/usr/bin/$pkgname"
}
Installing the script file is redundant since "python setup.py install" handles that; furthermore, it overwrites the version of the script that setup.py installed. This is problematic since "#!python" relies on setup.py adjusting the shebang for you, to point at the python interpreter which invoked setup.py.
The manual install -Dm755 line appears to be a legacy leftover from before "The executable is also a proper python script too now instead of a bash wrapper." An oversight...
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
An oversight...
Yep, sorry. The fix will be uploaded in a few minutes.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
okay, so this is really strange, the desktop file will launch successfully with one filename, but if I rename it it won't launch again
Offline
"I changed something and now it no longer works" isn't enough information for me to help you.
Did you change the .desktop extension? If so, why? Does "mimeo -m /path/to/renamed/file" still detect the MIME-type as "application/x-desktop"? If not, either fix the extension or add the new MIME-type to the generated desktop file above.
Mimeo uses Python's standard mimetypes module for MIME-type detection so there isn't much that I can do to improve that. MIME-type detection is basically guesswork and a lot of it relies on things like standard file extensions.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
yes I renamed it but preserved .desktop, mimeo detects both as application/x-desktop.
Offline
Post the output of
mimeo -m /path/to/desktop/file
mimeo -c /path/to/desktop/file
mimeo --exec -c /path/to/desktop/file
for both the original and renamed desktop file.
edit
If both report the same MIME-type then the behavior should be the same. Are you running the commands as different users (e.g. with sudo)? If so then you will need to set the preferences for the other user too.
Last edited by Xyne (2021-02-13 13:17:50)
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
$ mimeo -m ~/Desktop/brave-ppkpacoaenkjhabjboajcamojdgbjdgd-Profile.desktop
/home/tleydxdy/Desktop/brave-ppkpacoaenkjhabjboajcamojdgbjdgd-Profile.desktop
application/x-desktop
$ mimeo -m ~/Desktop/element.desktop
/home/tleydxdy/Desktop/element.desktop
application/x-desktop
$ mimeo -c ~/Desktop/brave-ppkpacoaenkjhabjboajcamojdgbjdgd-Profile.desktop
/usr/bin/mimeo --exec /home/tleydxdy/Desktop/brave-ppkpacoaenkjhabjboajcamojdgbjdgd-Profile.desktop
$ mimeo -c ~/Desktop/element.desktop
/usr/bin/mimeo --exec /home/tleydxdy/Desktop/element.desktop
$ mimeo --exec -c ~/Desktop/brave-ppkpacoaenkjhabjboajcamojdgbjdgd-Profile.desktop
/usr/lib/brave-bin/brave --user-data-dir=/home/tleydxdy/.config/BraveSoftware/Brave-Browser/Main --profile-directory=Profile --app-id=ppkpacoaenkjhabjboajcamojdgbjdgd
$ mimeo --exec -c ~/Desktop/element.desktop
$ diff ~/Desktop/brave-ppkpacoaenkjhabjboajcamojdgbjdgd-Profile.desktop ~/Desktop/element.desktop
$
Offline
Can you post the contents of the desktop files? It seems that element.desktop contains the path to brave-ppkpacoaenkjhabjboajcamojdgbjdgd-Profile.desktop so I suspect that one is not a copy of the other.
Also post the output of the following files if you have them:
/home/tmp/xyne/.config/mimeo/associations.txt
/etc/xdg/mimeo/associations.txt
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
The two file are the same, which is what I was trying to show with the diff command
I think I have figured out what is causing it, but I am still unsure of the why. So when I installed the PWA, the browser added copies of the desktop files to
~/.local/share/applications/
~/.gnome/apps/
~/Desktop/
One would think they are independent, but somehow they are not. specifically the ~/Desktop version will only run when the corresponding ~/.local version is present. This is what caused element.desktop to not work, once I copied element.desktop to ~/.local they both will work correctly.
note:
~/.Desktop version have this line at the top and is set to executable, the ~/.local one does not and is not executable (this doesn't effect the bug tho (I have xdg-open symlinked to mimeo))
#!/usr/bin/env xdg-open
Offline
The diff command in the output immediately followed the "mimeo --exec -c" command so I thought it was the output, which I found very confusing.
I've just tested mimeo with executable desktop files and the shebang #!/usr/bin/env mimeo and it works as expected after creating the custom desktop and preference as in my previous post. Aside from the use of the custom desktop file to handle the application/x-desktop MIME-type, it should be completely independent of the target desktop's location. There must be something in the desktop files under ~/Desktop beyond the shebang that differs from their counterparts in $XDG_DATA_HOME.
Without the contents of the desktop files I cannot reproduce or debug this.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Here's my current working setup
$ diff ~/Desktop/element.desktop ~/.local/share/applications/element.desktop
1d0
< #!/usr/bin/env xdg-open
$ cat ~/Desktop/element.desktop
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Terminal=false
Type=Application
Name=Element
Exec=/usr/lib/brave-bin/brave --user-data-dir=/home/tleydxdy/.config/BraveSoftware/Brave-Browser/Main --profile-directory=Profile --app-id=ppkpacoaenkjhabjboajcamojdgbjdgd
Icon=brave-ppkpacoaenkjhabjboajcamojdgbjdgd-Profile
StartupWMClass=crx_ppkpacoaenkjhabjboajcamojdgbjdgd
I think it's best if you use your browser to install a PWA, this will obviously not run on your machine.
Offline
Hello,
I'm sorry to post after all of this time but I couldn't find a way to do what I want even when reading this forum. So basically I have multiple firefox profiles with unique extensions for each profiles, I have one for private browsing, one for media like twitch/youtube/reddit for instance etc.
What I'd like to do is to open every link in the private profile by default (set to default in firefox so that's ok) and open any media link say "^https?://twitch.tv" links in the media profile but i'm not sure how to do that. I have firefox set to default right now (the private profile) and want to use firefox with the profile called "social" for twitch links so I tried this in "~/.config/mimeo/associations.txt"
/usr/bin/firefox -p social %U
^https?://(www.)?twitch.tv/
but that won't open firefox
mimeo -c https://www.twitch.tv/lirik
/usr/bin/firefox -p social https://www.twitch.tv/lirik
The output seems right but the action isn't. It's like it doesn't care about the arguments
Last edited by maplepy (2022-10-07 20:26:47)
Offline
I actually need help, thought I had it but it doesn't work so I edited my comment back
If anyone knows how I can use mimeo to do what I want that'd be awesome!
Edit:
this works fine for instance:
/usr/bin/firefox -p social https://www.twitch.tv/lirik
Last edited by maplepy (2022-10-07 20:21:45)
Offline
if pargs.command:
print_cmd(cmd)
else:
run_cmd(cmd, quiet=pargs.quiet)
The command that you see with the '-c" flag is the same command that is run without it. Are you running Mimeo as the user with that Firefox profile?
What does the log show if you run the command with "--debug"? Try it with and without the "-c" flag.
Last edited by Xyne (2022-10-10 20:14:20)
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
mimeo https://www.twitch.tv/lirik --debug
DEBUG: loading arguments from /home/maplepy/.config/mimeo/default_arguments.txt
DEBUG: checking /home/maplepy/.config/mimeo/associations.txt
DEBUG: loading /home/maplepy/.config/mimeo/associations.txt
DEBUG: /usr/bin/firefox -P social --class social https://www.twitch.tv/lirik
Both outputs are the exact same with and without the "-c" flag. Weirdest thing is, when I type mimeo and a twitch link for instance it works now but not when i click on it
Offline
Both outputs are the exact same with and without the "-c" flag. Weirdest thing is, when I type mimeo and a twitch link for instance it works now but not when i click on it
Where are you clicking the link? In your web browser? Console?
Wherever it is, you need to configure the program to invoke mimeo with the link. Mimeo cannot intercept clicks on its own.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Tried in the console or in apps and they always open in the default firefox not the "mimeo one", I know clicking it inside a web browser itself wont work
How do I do that? Do I need xdg-utils-mimeo or is it something else?
Offline
Is it possible to use wildcards when changing mimetypes associations?
Like:
mimeo --prefer "image/*" imv
to change the image viewer all the once for all image file types
EDIT: ok I have edited `~/.config/mimeapps.list ` directly and it seems to be working
Last edited by hully (2022-12-03 10:25:46)
Offline
Is it possible to use wildcards when changing mimetypes associations?
Like:
mimeo --prefer "image/*" imv
to change the image viewer all the once for all image file types
You can use
mimeo --prefer 'glob:image/*' ...
for glob matching. It's also possible to use regular expressions with the "regex:" prefix. See
mimeo --help
mimeo --mimeman-help
for details.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline