You are not logged in.
Hello! Recently, I've started to use Arch and the most popular option here as the music player is cmus - so I've installed it!
After I installed Thunar as my file manager and now I'm trying to configure it to open audio files using cmus. Please, could you help me to understand how to do it properly?
So after reading https://wiki.archlinux.org/index.php/de … plications and https://wiki.archlinux.org/index.php/Desktop_entries, I did the following:
Create .config/mimeapps.list
[Default Applications]
audio/mpeg=cmus.desktop;Create .local/share/applications/cmus.desktop
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Display=true
Exec=cmus %f
Terminal=true
Name=cmus
Comment=Music player cmusThen in Thunar I've added association cmus with mp3 track (the cmus successfully appeared in the list of applications), but after trying to open some tracks I always get the following error: "failed to execute child process xterm (no such file or directory)". What's wrong?
Last edited by timfayz (2016-02-06 09:34:50)
Offline
Use cmus-remote instead of cmus:
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Display=true
Exec=cmus-remote -f %f
Terminal=false
Name=cmus-remote
Comment=Music player cmus-remote controlMore cmus-remote options at "man cmus-remote".
Offline
Hm...Now there is no that error, but still it doesn't play(
EDIT: Good! Actually it plays, but only after I run the cmus itself. Hm.... It's ok? Can I make it run automatically in the different window?
Last edited by timfayz (2016-02-06 09:11:01)
Offline
Hm...Now there is no that error, but still it doesn't play(
EDIT: Good! Actually it plays, but only after I run the cmus itself. Hm.... It's ok? Can I make it run automatically in the different window?
Which different window? Also note, cmus-remote does need cmus to be running.
Finally, please don't use cmus just because it is popular. Since you are trying to integrate it with a file manager, a GUI music player might be more suitable for you.
Offline
Which different window? Also note, cmus-remote does need cmus to be running.
Finally, please don't use cmus just because it is popular. Since you are trying to integrate it with a file manager, a GUI music player might be more suitable for you.
I mean when track is running I want to see the player. Anyway I just want to understand how to do it. The first time I thought it will be quite simple, but actually it's awful! Damn mess with countless configuration files!:)
Offline
So this is what I place to cmus.desktop:
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Display=true
Exec=cmus-remote -f %f
Terminal=false
Name=cmus
Comment=Music player cmus-remoteIf cmus isn't running Thunar plays nothing. If I run cmus in advance, it "catch" the track. What do I wrong?
Offline
You did nothing wrong. As I said, cmus-remote needs cmus to be running first.
So, first launch cmus, then use cmus-remote. As for bringing the cmus window to focus when playing the song, I don't think it is as simple to do. You can write a wrapper script which will first ensure that cmus is running, then load that song in cmus, then use something like xdotool to search for the cmus window and bring it to focus.
Easier option: Cmus has a file browser mode (press number 5 when inside cmus). Use that.
Even easier option: Use a GUI music player.
Offline
Also note, cmus-remote does need cmus to be running.
Oh...my English! I thought you wrote "doesn't"! No there is no question. Thanks all!
Offline
@timfayz,
It would be great if you post which option you went with, so that other users with similar questions might be helped.
Offline
Just to follow up with a solution that meets the OP's requirements, here is a desktop file that will play the file in cmus, starting cmus if it's not already running, and bringing the window to the front (requires wmctrl):
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Display=true
Exec=bash -c "(! pgrep cmus && xfce4-terminal -T cmus -x cmus); sleep 1 && cmus-remote -f %f; wmctrl -a cmus"
Terminal=false
Name=cmus-remote
Comment=Music player cmus-remote control
NoDisplay=true
Icon=cmusOffline
@timfayz,
It would be great if you post which option you went with, so that other users with similar questions might be helped.
The solution I stick with is the second post of @toz:
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Display=true
Exec=cmus-remote -f %f
Terminal=false
Name=cmus-remote
Comment=Music player cmus-remote controlI just always keep open cmus in separate window, so that's all:)
Offline