Forums

protocol "playonlinux" isn't associated and when i associated dont working

Why not works , and a Suggention

Auteur Réponses
inukaze Jeudi 4 Juin 2015 à 22:07
inukaze

Well , i am in the "Scripts" Section , and know i see "Super Crate Box" , and i try to install it from the webpage , and

my internet browser , dont have idea , of that protocol called "playonlinux://" , well i remember in the 2014 i make an script for Ace Of Spade , and i make the mime type asociation for the protocol , Here The Script

 

Well looking my old script , i make this , for make the asociaciotion , with the playonlinux protocol , and why dont put a button in the next version of PlayOnLinux for "Make protocol Asociations" ???

 

Here i wrote a script for this ( need : locale , grep , sed , rm , playonlinux ) :

 

#!/bin/bash

Autor ----------------> Inukaze ( Venezuela )
Sitio ----------------> inukaze.wordpress.com
Correo-E -------------> inukaze.otaku@gmail.com
Licensia -------------> GPL 2

#Variables :
MIMESA="$HOME/.local/share/applications/mimeapps.list"
MIMESL=$(cat $HOME/.local/share/applications/mimeapps.list | grep "x-scheme-handler/playonlinux=urlpol.desktop")
MIMESC="$HOME/.local/share/mime"
MIMEPF="$HOME/.local/share/applications/urlpol.desktop"
POLUHS=$(locate playonlinux-url_handler | grep -i "playonlinux-url_handler" | cut -d " " -f02 | head -n 1)

# Configure :

# First Add The Mime Type
if [ -z "$MIMESL" ]; then
        sed -i '/\[Default Applications\]/a x-scheme-handler/playonlinux=urlpol.desktop' "$MIMESA"
else
    echo "Nothing to do"
fi

# Second check the Desktop File
# For Open File with this protocol exist
# If exist , delete it , else , create it

if [ -e "$MIMEPF" ]; then
    rm -rf "$MIMEPF"
else
    echo "Not exist the file $MIMEPF , creating . . ."
fi

# Creating The File to Open The Protocol :

echo '[Desktop Entry]
Name=PlayOnLinux
Exec='$POLUHS' '"%u"'
Icon=/usr/share/playonlinux/etc/playonlinux.png
Type=Application
Terminal=false'|tee "$HOME/.local/share/applications/urlpol.desktop" &> /dev/null

# Give permisson of execution
chmod a+o+x "$HOME/.local/share/applications/urlpol.desktop"

# Update the mime database , for appear in the asociations of mime files
update-mime-database $MIMESC

 

Well , i dont know why this dont work :

$ /usr/share/playonlinux/bash/playonlinux-url_handler playonlinux://www.playonlinux.com/repository/download.php?id=2542

 

and this wont work too :

 

$ /usr/share/playonlinux/playonlinux-url_handler playonlinux://www.playonlinux.com/repository/download.php?id=2542  File "/usr/share/playonlinux/python/wrapper.py", line 28
    print "ERROR ! Please define POL_OS environment var first."
                                                              ^
SyntaxError: Missing parentheses in call to 'print'

 

and well , how i can make the "playonlinux" protocol works for install scripts from the website ???

 

i think need a better script for "playonlinux-url_handler" , because its not working for me

 

if someone found a solution for this , please write me :D , via Private Message or Email , please.


 

Edité par inukaze

Ronin DUSETTE Jeudi 4 Juin 2015 à 22:12
Ronin DUSETTE

If someone finds a solution, wouldn't it be much better to have them just post in the forums so everyone can benefit? :)


Please:
Post debug logs & full computer specs in first post
No private messages for general help, use the forums
Read the wiki, Report broken scripts
Quentin PÂRIS Jeudi 4 Juin 2015 à 22:48
Quentin PÂRISAnonymous

The problem comes from the fact that you are running the urlhandler with python3, which is not supported by PlayOnLinux v4.

We need to add the same mechanism as in playonlinux script

inukaze Jeudi 4 Juin 2015 à 23:47
inukaze

Thank you for your answers :) , yes its better put in the forum , but i wanna try if really works XD , and not add too much messages if some user tell me works for his , but if i try and dont work for me , i can try to solve begin with the solution of his user XD

 

Ok then i edit the file :

 

sudo nano /usr/share/playonlinux/playonlinux-url_handler

 

and change the line :

exec python "$CURDIR/python/wrapper.py" "$CURDIR/bash/$(basename "$0")" "$@"

To

exec python2 "$CURDIR/python/wrapper.py" "$CURDIR/bash/$(basename "$0")" "$@"

 

and now works for me , someone can test if works too ???

 

Edité par inukaze

inukaze Vendredi 5 Juin 2015 à 21:44
inukaze

Why in the next version of PlayOn , your include "python2" and "python3" inside the  "PlayOn" , for not use the system python . and make for a time the protocol works ???

 

You can add another tools inside POL , like 7z , i prefer you include all tools , need by the application :D

Levan Samedi 6 Juin 2015 à 0:58
Levan

I thought POL is dropping Python support and moving to JAVA. something that I am not crazy about but they are the devs.

Ronin DUSETTE Samedi 6 Juin 2015 à 7:23
Ronin DUSETTE

 

I thought POL is dropping Python support and moving to JAVA. something that I am not crazy about but they are the devs.

 

This is not the thread to voice that in. ;) If you have objections, please do let us know. We really want as much legit, technical feedback from the community as we can get (though, no trolls, please. lol.):

https://www.playonlinux.com/en/topic-13046-PlayOnLinux_5.html
https://www.playonlinux.com/en/comments-1295.html

Edité par RoninDusette


Please:
Post debug logs & full computer specs in first post
No private messages for general help, use the forums
Read the wiki, Report broken scripts

This site allows content generated by members, and we promptly remove any content that infringes copyright according to our Terms of Service. To report copyright infringement, please send a notice to dmca-notice@playonlinux.com