Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auto-start isn't working #55

Closed
jvschiavo opened this issue May 14, 2021 · 15 comments
Closed

auto-start isn't working #55

jvschiavo opened this issue May 14, 2021 · 15 comments

Comments

@jvschiavo
Copy link

I'm having trouble with auto-start, it isn't working. Could I get some help?

I followed the instructions here in this github. This log might have some relevant information:

my_user@pc:~$ lsb_release -a
No LSB modules are available.
Distributor ID:	Linuxmint
Description:	Linux Mint 20.1
Release:	20.1
Codename:	ulyssa
my_user@pc:~$ uname -a
Linux pc 5.8.0-53-generic #60~20.04.1-Ubuntu SMP Thu May 6 09:52:46 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
my_user@pc:~$ whereis play-with-mpv
play-with-mpv: /home/my_user/.local/bin/play-with-mpv
my_user@pc:~$ ls /usr/share/applications/ | grep ^th
thunar-bulk-rename.desktop
thunar.desktop
thunar-settings.desktop
thunar-volman-settings.desktop
thunderbird.desktop
my_user@pc:~$ ls -l ~/.local/share/applications/thann.play-with-mpv.desktop
-rwxrwxr-x 1 my_user my_user 310 mai 13 21:46 /home/my_user/.local/share/applications/thann.play-with-mpv.desktop
my_user@pc:~$ ls -l ~/.local/bin/play-with-mpv 
-rwxrwxr-x 1 my_user my_user 214 mai 13 21:46 /home/my_user/.local/bin/play-with-mpv
my_user@pc:~$ ls -l ~/.config/autostart/thann.play-with-mpv.desktop 
-rwxrwxr-x 1 my_user my_user 310 mai 13 21:51 /home/my_user/.config/autostart/thann.play-with-mpv.desktop
my_user@pc:~$ diff ~/.local/share/applications/thann.play-with-mpv.desktop ~/.config/autostart/thann.play-with-mpv.desktop 
my_user@pc:~$ cat ~/.config/autostart/thann.play-with-mpv.desktop 
#!/usr/bin/env xdg-open
[Desktop Entry]
Categories=AudioVideo;Audio;Video;Player;TV
Comment=Chrome extension and python server that allows you to play videos in webpages with MPV instead.
Exec=/play_with_mpv-0.1.0.post9+g07a9c1d.data/scripts/play-with-mpv
Icon=mpv
Name=Play With MPV (server)
Type=Application
@jvschiavo
Copy link
Author

Nevermind, I managed to fix this thanks to #20

I deleted the shebang line (not sure if this was needed) and fixed the correct Exec path.

@jvschiavo
Copy link
Author

Now it isn't autostarting anymore. I have no idea why. :/

@jvschiavo jvschiavo reopened this May 18, 2021
@Chaostheorie
Copy link

Any logs or versions you might be able to supply? Maybe it tries to listen on an already used port or sth.

@jvschiavo
Copy link
Author

jvschiavo commented Jun 15, 2021

Ok, it started working again... I'm not sure why. I think that when I checked before I was looking for the term "thann" in htop (to see if it was running) when the process name was actually "play-with-mpv". Not sure though why it wasn't working that time.

Maybe I should close the issue for now until I have another problem like this? Or do you think some kind of information might be useful right now?

@Chaostheorie
Copy link

Good to hear, that you problem has been resolved. As long as it works and you can't replicate the problem anymore, you can close the issue. Just reopen it, if you find a reproducible problem later on.

@bheeshmpita
Copy link

bheeshmpita commented Sep 18, 2021

Good to hear, that you problem has been resolved.

@Thann @Chaostheorie Hi there, I am facing issue with it , opened issue #62
i cant find play-with-mpv executable file according to the location mentioned in desktop file. so I was thinking to place the required files via zip download.
I'm a beginner in Linux, need your help. thanks

@Chaostheorie
Copy link

@bheeshmpita if you have installed it with pip (via pip install git+git://github.com/thann/play-with-mpv --user) you will need to add pip's location for executables in the PATH (PATH is a list of directories where your shell looks when searching for executables) too. If you haven't done this step yet, refer to this SO answer.

Otherwise, please try to locate the binary (i.e., locate play-with-mpv) and add the found DIR to `PATH. In case it finds nothing, please provide information about your OS and open a separate issue.

@bheeshmpita
Copy link

@Chaostheorie

refer to this SO answer.

though the answer is brief still I cant apprehend it. this is how my ~/.profile looks.

`# ~/.profile: executed by the command interpreter for login shells.

This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login

exists.

see /usr/share/doc/bash/examples/startup-files for examples.

the files are located in the bash-doc package.

the default umask is set in /etc/profile; for setting the umask

for ssh logins, install and configure the libpam-umask package.

#umask 022

if running bash

if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi

set PATH so it includes user's private bin if it exists

if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi

set PATH so it includes user's private bin if it exists

if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
fi
`

locate play-with-mpv

i tried this and it listed only contents in the zip i downloaded in order to place at the missing executable file. Can I do it with zip?

@Chaostheorie
Copy link

Chaostheorie commented Sep 19, 2021

@bheeshmpita Okay. Then a full on guide with the ZIP. Since if [ -d "$HOE/.local/bin … is in your profile, we can just use the existing ~/.local/bin/ dir.

Assumes you have gotten the source code zip from the releases page in your current dir (i.e. Downloads/). If you need to go to that dir use cd <dir>

  • Create local bin (does nothing if already exists): mkdir -p ~/.local/bin/
  • unzip the archive: unzip play-with-mpv-0.1.0.zip
  • enter the extracted dir: cd play-with-mpv-0.1.0/

Two paths are now open:

  • Either Install with pip (highly recommended): python3 -m pip install .
  • Move python file to local bin: mv play_with_mpv.py ~/.local/bin/

To run the server:

  • When installed with pip: play-with-mpv
  • When moved to local bin: play_with_mpv.py

@bheeshmpita
Copy link

bheeshmpita commented Sep 19, 2021

@Chaostheorie

Two paths are now open:
Either Install with pip (highly recommended): python3 -m pip install .

does this command be executed after moving into a specific folder ie cd in the terminal?

@Chaostheorie
Copy link

@bheeshmpita Yes after the previous cd command. The commands are meant to be run on after another in the same terminal. This means you start by opening a terminal, navigating to the DIR where the zip is placed, unzip it, and enter the newly created folder. At this point you can choose to either install with pip, i.e., python3 -m pip install ., or move the file directly mv play_with_mpv.py ~/.local/bin/.

@bheeshmpita
Copy link

bheeshmpita commented Sep 19, 2021

@Chaostheorie it seems there is problem in python script in the zip. following was the output

abhi@hdd-bodhi-linux:~/.local/bin$ play_with_mpv.py File "/home/abhi/.local/bin/play_with_mpv.py", line 96 print(f"ERROR: {bin.upper()} does not appear to be installed correctly! please ensure you can launch '{bin}' in the terminal.") ^ SyntaxError: invalid syntax

@Chaostheorie
Copy link

Chaostheorie commented Sep 19, 2021

Change the first line of the script from #!/usr/bin/env python to #!/usr/bin/env python3. This error occurs since the script uses python3.8 syntax, and you seem to have python version 2 set as default.

(Note: to edit a file either use nano (i.e. nano ~/.local/bin/play_with_mpv.py, edit, and save and exit with Ctrl+O) or your favourite text editor)

@bheeshmpita
Copy link

@Chaostheorie THANK YOU so much brother. it worked. does this extension have any automated command to play with mpv or does it have to be done by user always?
Thanks again

@Chaostheorie
Copy link

@bheeshmpita Your welcome. I'm not aware of any automatic way of playing videos on page load, but there's already an issue (#31) for this feature open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants