You are not logged in.
Hi!
For the really beginners of the XMMS2 users as me, should be a nice something like a guide/tutorial.
Here is the bash scripts that might enchant functionality and be more useful for use of the media keys.
For randomizing before any other action you can use even something like:
xmms2 playlist shuffle ; xmms2 jump 1; xmms2 play
# Just for dummies
The Preview hotkey loop.
From the begin of the playlist to the end of it when current is the first one being played:
#!/bin/bash
#Play the previews or first if end of the playlist
if [ "XX"$(xmms2 prev | awk '{print $1}') == "XXServer" ] ; then
if [ "XX"$(xmms2 jump $(xmms2 list | grep -i '/' |wc -l) | awk '{print $1}') == "XXServer" ] ; then
xmms2 playlist list;
echo The playlist is empty, please choose one from of the above ;
echo or add a new songs to the playlist with a '"xmms2 add"';
fi; fi;
#It takes time to count to the last song in the playlist, longer it is more time it takes :(. I haven't found a better way yet.
The Next hotkey loop.
When the end of the playlist is reached then goto jumping to the first one song in the playlist:
#!/bin/bash
#Play the first song if in the end of the playlist
if [ "XX"$(xmms2 next | awk '{print $1}') == "XXServer" ] ; then
if [ "XX"$(xmms2 jump 1 | awk '{print $1}') == "XXServer" ] ; then
xmms2 playlist list;
echo The playlist is empty, please choose one from of the above ;
echo or add a new songs to the playlist with a '"xmms2 add"';
fi; fi;
For the Play/Pause key:
#!/bin/bash
#For the single Play/Pause key
GetStatus=$(xmms2 current | awk -F":" '{print $1}')
#Any command line parameters to the script for randomizing of the playslist.
if [ "S" != "S"$1 ] ; then
xmms2 playlist shuffle
fi;
if [ "$GetStatus" == "Playing" ]; then xmms2 pause;fi
if [ "$GetStatus" == "Paused" ]; then xmms2 play;fi
if [ "$GetStatus" == "Stopped" ]; then
xmms2 play
GetStatus=$(xmms2 current | awk -F":" '{print $1}')
if [ "$GetStatus" == "Stopped" ]; then
xmms2 playlist list;
echo The playlist is empty, please choose one from of the above ;
echo or add a new songs to the playlist with a '"xmms2 add"';
fi
fi
or you can use even xmms2 toggle command line for the play/pause hotkey.
Turn On/Off repeat/loop of the playlist:
#!/bin/bash
GetStatus=$(xmms2 server config playlist.repeat_all )
case $GetStatus in
"playlist.repeat_all = 1") xmms2 server config playlist.repeat_all 0 ; sudo beep; echo is OFF ;;
"playlist.repeat_all = 0") xmms2 server config playlist.repeat_all 1 ; sudo beep ; sudo beep ; echo is ON;;
esac
You can install beep but the beep has a problem, you can run it only as a root but a more danger way is to by pass this by adding the beep into /etc/sudoers , e.g. yourusername ALL=NOPASSWD: /usr/sbin/beep. Be careful! It may expose your system for unwanted access to and do a harm. The best way is to find a better way for notification of changes.
If someone has another script solutions for the multimedia hotkeys or media fun for XMMS2 then please share with us!
Automation is power of the shell
Notice
The hotkey names of my Digital Media Keyboard 3000, but I think that it becomes more as a standard, it is just to get a faster access to the names.
XF86AudioPlay, XF86AudioNext, XF86AudioPrev,XF86AudioStop
XF86AudioMute (amixer -c 0 set Master toggle), *, (pactl set-sink-mute 0 toggle)
XF86AudioRaiseVolume (amixer -c 0 set Master 3+), xmms2 server volume +3, (pactl set-sink-volume 0 +3%)
XF86AudioLowerVolume (amixer -c 0 set Master 3-). xmms2 server volume -3, (pactl set-sink-volume 0 -- -3%)
amixer = ALSA
pactl = PulseAudio (0 is index of the sinks, you can see which you can use with pacmd list-sinks, marked with * is default)
The other way to increase and decrease volumes is here.
Change between ALSA and PulseAudio sound servers for XMMS2
nyxmms2 server config output.plugin pulse
nyxmms2 server config output.plugin alsa
Otherwise you can use xev to retrieve the names of the supported keys by X server, as I know X server has a limitations to the 255 key numbers/keycodes. One more but less useful for GUI is showkey, just to know that it is also and always exists, with a great manual about the kbd keys.
* To mute/unmute XMMS2 you can use xmms2 server volume 0 / xmms2 server volume 100 or for more advanced e.g. xmms2 server volume -c left 100/xmms2 server volume -c right 100 and combine with any keys you wish the way is best for you. I haven't found any way to make anything to remember status after mute/unmute of xmms2. Alias for the mute only is xmms2 mute. If you will find it before me please help .
Here is one more guide for the BlackBox menu. I could not get xmms2 mlib loadall to work in Arch.
In Arch you must use xmms2 playlist sort instead of xmms2 sort because it doesn't work otherwise.
xmms2 playlist sort album
xmms2 playlist sort title
xmms2 playlist sort artis
Last edited by Andy_Crowd (2014-10-18 11:34:45)
Help to make Arora bug free!!
日不落 | Year 2081 | 笑傲江湖 | One more a really good book in my collection the Drystoll.
Offline