Пробовали ли вы в разговоре с пользователем оффтопика упомянуть про консольные программы, например про музыкальный плеер MOC? Попробуйте. Вы увидите бурю эмоций. Вам начнут доказывать, что в нормальной системе всё должно делаться через gui, возможно даже предложат поставить ms-dos. Реакция эта вполне предсказуема, ведь даже для некоторых пользователей linux слово "консольный" звучит как "сложный, непонятный, некрасивый". На самом же деле отсутствие gui у программы означает только то, что мы можем заставить её выглядеть так, как сами захотим. Я, например, хочу, чтобы мой плеер выглядел так:

В этой статье я расскажу, как этого добиться.
Инструкция предназначена исключительно для пользователей GNOME. Кроме меня это никем не тестировалось, так что всё это Вы делаете на свой страх и риск.
Для начала нам понадобятся несколько пакетов: notify-osd из ppa, libnotify-bin, gtrayicon и, собственно, сам moc.
1. Установка notify-osd
Примечание: если вам нравится внешний вид всплывающих уведомлений в Вашей системе, вы можете пропустить этот шаг, тогда уведомления от плеера будут выглядеть точно так же, как сейчас выглядят уведомления от других программ, таких как pidgin, transmission, etc.sudo add-apt-repository ppa:leolik/leolik
sudo apt-get update && sudo apt-get upgrade
2. Установка остальных необходимых пакетов
sudo apt-get install moc libnotify-bin gtrayicon
Также нам понадобится скриптик, описанный
здесь. Скачать его можно по ссылке, либо взять здесь:
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys,os
import pynotify
import socket,re,urllib
def pushNotification (title, body, icon):
n = pynotify.Notification (title, body, icon);
n.set_hint_string ("x-canonical-append", "");
n.show ()
def server():
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) #initializing connection
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
#вешаемя на 8091 порт
s.bind(('127.0.0.1',8091))
print "Waiting for connections..."
s.listen(5)
while 1:
#принимаем соединение
clientsock, clientaddr = s.accept()
print "Got connection from", clientsock.getpeername()
clientsock.sendall("HTTP/1.0 200 OK\r\n")
req = clientsock.recv(1024) #считываем весь запрос
get=re.findall(r"GET /(.*) HTTP/1.",req)
#получаем get (после слеша в запрашиваемом адресе)
if get:
#парсим сообщение
icon,sender,message=urllib.url2pathname(get[0]).strip("'").split("' '")
#print message+" "+sender
pushNotification(sender,message,icon);
#Посылаем ok, что-бы wget не расстраивался
clientsock.sendall("Content-Type: text/html\r\n")
clientsock.sendall("Content-Length: " + str(len("ok")) + "\r\n")
clientsock.sendall("\r\n")
clientsock.sendall("ok")
clientsock.close()
if __name__ == '__main__':
if not pynotify.init ("append-hint-example"):
sys.exit (1)
server()
Добавляем его в запускаемые приложения, как описано в ссылке выше. Не забудьте дать права на исполнение!
Теперь можно приступать к настройке.
3. Настройка moc
По поводу настройки этого плеера написано множество мануалов, по этому я просто приведу свой конфигурационный файл. Ему нужно дать имя config и положить в скрытую папку .moc в своей домашней папке.
Если Вам не нужна работа с кодировкой cp1251 и рандомизация дорожек, можете пропустить этот пункт.# This is a configuration file for the MOC player. It should be named 'config'
# and placed in the directory ~/.moc/
# Comments begin with '#'.
# You can use quotes and escape ('\') in parameters.
# Show file titles (title, author, album) instead of file names.
ReadTags = yes
# Directory in which you store music files. If you specify it you will be able
# to quickly go to this directory with the '-m' parameter or the 'm' command.
# This can also point to a playlist.
MusicDir = "~/Музыка"
# How to sort? FileName is the only option for now.
Sort = FileName
# Show errors in the streams, for example CRC errors or broken frames in mp3
# files.
ShowStreamErrors = no
# Ignore CRC errors in MP3 files. Most players do that, so the default value is
# set to yes.
Mp3IgnoreCRCErrors = yes
# Turn on repeat.
Repeat = yes
# Turn on shuffle.
Shuffle = yes
# Turn on AutoNext.
AutoNext = yes
# Default FormatString:
# %n - Track number
# %a - Artist
# %A - Album
# %t - Title
# %(X:TRUE:FALSE) - ternary expression - if X exists, do TRUE, otherwise
# FALSE. '\' - escape character (must be double, because of
# config interpreter). man zshmisc for more info.
FormatString = "%(n:%n :)%(a:%a - :)%(t:%t:)%(A: \(%A\):)"
# Output buffer size in kilobytes. Minimum value is 128KB. */
OutputBuffer = 2048
# Input buffer size in kilobytes. Minimum value is 32KB. */
InputBuffer = 512
# How much to fill the input buffer before playing (in kilobytes)?
# This can't be more than InputBuffer value.
# Remember that for network streams beside the positive effect this also causes
# delay between what you can hear and what is broadcasted.
Prebuffering = 64
# Use this HTTP proxy server for internet streams. If not set, the
# environment variables http_proxy and ALL_PROXY will be used if present.
#HTTPProxy = my_proxy:port
# Sound driver - OSS, ALSA, JACK, or null (only for debugging).
# You can enter more than one driver separated by a comma. The first working
# driver will be used.
SoundDriver = ALSA
# Jack output settings.
#JackOutLeft = "alsa_pcm:playback_1"
#JackOutRight = "alsa_pcm:playback_2"
# OSS output device.
#OSSDevice = /dev/dsp
# OSS Mixer device.
#OSSMixerDevice = /dev/mixer
# OSS Mixer channel: pcm or master.
#OSSMixerChannel = pcm
# Second OSS Mixer channel: pcm or master.
#OSSMixerChannel2 = master
# ALSA mixer device.
AlsaMixer = PCM
# Second ALSA mixer device.
AlsaMixer2 = Master
# ALSA output device.
AlsaDevice = default
# Save software mixer state?
# If enabled, a file 'softmixer' will
# be created in '~/.moc/' storing the
# mixersetting set when the server is shut-down.
# Note that there is a 'hidden' 'Amplification'
# setting in that file.
# Amplification (0-200) is used to scale
# the mixer setting (0-100). This results
# in a higher signal amplitude but may also
# produce clipping.
#Softmixer_SaveState = yes
# Save equalizer state?
# If enabled, a file 'equalizer' will
# be created in '~/.moc/' storing the
# equalizer settings when the server is shut-down.
# There is a 'hidden' 'Mixin' setting in that file.
# Mixin (0.0-1.0) is used to determine how much of
# the original signal is used after equalizing.
# 0 means to only use the equalized sound, 1
# effectively disabled the mixer.
# Default is 0.25
#Equalizer_SaveState = yes
# Show files with dot at the beginning?
ShowHiddenFiles = no
# Start in the music directory if no arguments are given. If set to no, start
# in the current directory.
StartInMusicDir = yes
# Hide file name extensions.
HideFileExtension = yes
# Show file format in menu.
ShowFormat = no
# Show file time in menu. Possible options: yes, no, IfAvailable - show the
# time only when it was read before (often works faster).
ShowTime = IfAvailable
# Theme file. This can be absolute path or relative to
# /usr/share/moc/themes/ (depends on installation prefix) or ~/.moc/themes/
Theme = transparent-background
# The theme used when running on an xterm.
XTermTheme = transparent-background
# MOC directory - where pid file, socket, and state files are stored.
# You can use ~ at the beginning.
# MOCDir = ~/.moc
# Use mmap() to read files. mmap() is much slower on NFS.
UseMmap = no
# Assume this encoding for ID3 version 1/1.1 tags (mp3 files). Unlike ID3v2
# UTF-8 is not used here and MOC can't guess how tags are encoded. Another
# solution is using librcc (see the next option). This option is ignored
# if UseRCC is set to yes.
ID3v1TagsEncoding = WINDOWS-1251
# Use librcc to fix ID3 version 1/1.1 tags encoding.
UseRCC = no
# Use librcc to filenames and directory names encoding.
#UseRCCForFilesystem = yes
# Remember the playlist after exit?
SavePlaylist = yes
# When using more than one client (interface) at a time, do they share the
# playlist?
SyncPlaylist = yes
# Choose a keymap file (relative to ~/.moc/ or absolute path).
# Example keymap with description is included (keymap.example).
#Keymap = my_keymap
# Use ASCII characters instead of graphic for drawing lines. This helps on
# some terminals.
ASCIILines = no
# FastDirs, these allow you to jump directly to a directory, the key bindings
# are in the keymap file.
#Fastdir1 = /mp3/rock
#Fastdir2 = /mp3/electronic
#Fastdir3 = /mp3/rap
#Fastdir4 = /mp3/etc
#Fastdir5 =
#Fastdir6 =
#Fastdir7 =
#Fastdir8 =
#Fastdir9 =
#Fastdir10 =
# How fast to seek? Number of seconds per key stroke.
#SeekTime = 1
# How fast to seek (when using silent seeking)? Number of seconds per key
# stroke.
#SilentSeekTime = 5
# Resample method to use. There are a few methods of resampling sound supported
# by libresamplerate. The default is the fastest (linear). Better description
# is here: http://www.mega-nerd.com/libsamplerate/api_misc.html#Converters
#
# High quality (based on bandlimited interpolation), but slow methods:
#
# SincBestQuality - really slow (I know you probably have an xx GHz processor,
# but it's not enough to not see this in the top output :)
# The worst case Signal-to-Noise Ratio is 97dB.
# SincMediumQuality - much faster.
# SincFastest - the fastest bandlimited interpolation.
#
# Poor quality, but much faster methods:
#
# ZeroOrderHold - really poor quality, but it's really fast.
# Linear - a bit better and a bit slower.
#
#ResampleMethod = Linear
# Always use this sample rate when opening the audio device (and resample the
# sound if necessary). When set to 0 the device is opened with the file's rate.
#ForceSampleRate = 48000
# By default even if the sound card reports that it can output 24bit samples
# MOC converts 24bit PCM to 16bit. This option set to yes allows MOC to use
# 24bit output (for example MP3 decoder uses this format). This is disabled
# in the default configuration because there were reports that it prevents
# MP3 files from playing on some soundcards.
#Allow24bitOutput = no
# Use realtime priority for output buffer thread. This will prevent gaps while
# playing even with heavy load. The user which runs MOC must have permissions
# to set such a priority. This could be dangerous, because it is possible that
# a bug in MOC will freeze your computer.
#UseRealtimePriority = no
# Size of the in-memory cache for file tags in KB.
TagsCacheSize = 256
# Number items in the playlist.
#PlaylistNumbering = yes
# Main window layouts can be configured. You can change the position and the
# size of the menus (directory and playlist). You have 3 layouts and switch
# between then using the 'l' key (standard mapping). By default only 2 layouts
# are configured.
#
# The format is as follows:
# Each menu is described in the format NAME:POSITION_X,POSITION_Y,WIDTH,HEIGHT
# NAME is directory or playlist.
# The other parameters define position and size of the menu. They can be
# absolute numbers (like 10) or a percent value of the screen size (like 45%).
# WIDTH and HEIGHT can have value of FILL which means fill the screen from
# the menu's position to the border.
# Separate menu descriptions using a space.
# Menus may overlap.
# You must describe at least one menu (default is to fill the whole window).
# There must be at least one layout (Layout1) defined. Others can be empty ("").
#
# Examples:
#
# Just one layout, the directory will occupy the whole screen, the playlist
# will have 1/4 of the screen size and be positioned at lower right corner.
# Layout1 = "playlist:50%,50%,50%,50%"
# Layout2 = ""
# Layout3 = ""
#
# The screen is split into two parts: playlist at the top and the directory
# menu at the bottom. Playlist will occupy 10 lines and the directory menu
# the rest.
# Layout1 = "playlist:0,0,100%,10 directory:0,10,100%,FILL"
#
# Default configuration:
# Layout1 = "directory:0,0,50%,100% playlist:50%,0,50%,100%"
# Layout2 = "directory:0,0,100%,100% playlist:0,0,100%,100%"
# Layout3 = ""
# When the song changes, should the menu be scrolled so that the currently
# played file is visible?
FollowPlayedFile = yes
# What to do if the interface was started and something from the playlist is
# playing? If CanStartInPlaylist is set to "yes", the interface will switch to
# the playlist. When set to "no" it will start from the last directory.
CanStartInPlaylist = yes
# Executing external commands (1 - 10) invoked with key commands (F1 - F10 by
# default).
# Some arguments are substituted before executing:
# %f - file path
# %i - title made from tags
# %S - start block mark (in seconds)
# %E - end block mark (in seconds)
#
# Data from tags:
# %t - title
# %a - album
# %r - artist
# %n - track
# %m - time of the file (in seconds)
#
# Parameters above apply to the currently selected file. If you change them to
# capital letters, they are taken from the file currently playing.
#
# Programs are run using execv(), not a shell, so you can't do things like
# redirecting the output to a file. The command string is split using blank
# characters as separators, the first element is the command to be executed
# and the rest are parameters, so if you use "echo Playing: %I" we run program
# echo (from $PATH) with 2 parameters: 'Playing:' string and the title. Even
# if the title contains spaces it's still one parameter and it's safe if it
# contains `эрэм эрэф /`.
#
# Examples:
# ExecCommand1 = "cp %f /mnt/usb_drive"
# ExecCommand2 = "/home/joe/now_playing %I"
# Display the cursor in the line with the selected file. This can be useful with
# a braille display.
# UseCursorSelection = no
# Set the terminal title when running under xterm.
#SetXtermTitle = yes
# Set the terminal title when running under screen.
#SetScreenTitle = yes
# Display full paths instead of just file names in the playlist.
PlaylistFullPaths = no
# The following setting describes to how block markers are displayed
# in the play time progress bar. Its value is a string of exactly three
# characters. The first character is displayed in a position which
# corresponds to the time marked as the start of a block and the last
# character to the time marked as the end of the block. The middle
# character is displayed instead if both the start and the end of the block
# would fall in the same position (within the resolution of the interface).
# You can turn off the displaying of these block marker positions by using
# three space characters.
#BlockDecorators = "`\"'"
# How long (in seconds) to leave a message displayed on the screen.
# Setting this to a high value allows you to scroll through the messages
# using the 'hide_message' key. Setting it to zero means you'll have to
# be quick to see any message at all. Any new messages will queued up
# and displayed after the current message's linger time expires.
#MessageLingerTime = 3
# Does MOC display a prefix on delayed messages indicating
# the number of queued messages still to be displayed?
#PrefixQueuedMessages = yes
# String to append to the queued message count if any
# error messages are still waiting to be displayed.
#ErrorMessagesQueued = "!"
# Enable oversampling (yes/no).
#ModPlug_Oversampling = yes
# Enable noise reduction (yes/no).
#ModPlug_NoiseReduction = yes
# Enable reverb (yes/no).
#ModPlug_Reverb = no
# Enable mega-bass (yes/no).
#ModPlug_MegaBass = no
# Enable surround (yes/no).
#ModPlug_Surround = no
# Resampling mode. One of FIR/SPLINE/LINEAR/NEAREST:
# FIR : 8 tap fir filter (extremely high quality).
# SPLINE : Cubic spline interpolation (high quality).
# LINEAR : Linear interpolation (fast, good quality).
# NEAREST : No interpolation (very fast, extremely bad sound quality).
#ModPlug_ResamplingMode = FIR
# Number of channles (1 or 2).
#ModPlug_Channels = 2
# Bits per sample (8,16,32). 32 Bits seems to be buggy...
#ModPlug_Bits = 16
# Sampling rate (11025, 22050, 44100, 48000).
#ModPlug_Frequency = 44100
# Reverb level 0(quiet)-100(loud).
#ModPlug_ReverbDepth = 0
# Reverb delay in ms, usually 40-200ms.
#ModPlug_ReverbDelay = 0
# Bass level 0(quiet)-100(loud).
#ModPlug_BassAmount = 0
# Bass cutoff in Hz (10-100).
#ModPlug_BassRange = 10
# Surround level 0(quiet)-100(heavy).
#ModPlug_SurroundDepth = 0
# Surround delay in ms, usually 5-40ms.
#ModPlug_SurroundDelay = 0
# Number of times to loop. Zero prevents looping. -1 loops forever.
#ModPlug_LoopCount = 0
#TiMidity-Options.
# Rate must be in between 8000 and 48000.
#TiMidity_Rate = 44100
# Bitrate is 8 or 16.
#TiMidity_Bits = 16
# Channels is 1 or 2.
#TiMidity_Channels = 2
# Volume-Range is 0-800.
#TiMidity_Volume = 100
# You can setup a TiMidity-Config-File here.
# Leave unset to use library defaults (/etc/timidity.cfg mostly).
#TiMidity_Config =
# SidPlay2-Options.
# Default length of a song if not in database (seconds).
#SidPlay2_DefaultSongLength = 180
# Play at least a specific time if song is shorter (seconds).
#SidPlay2_MinimumSongLength = 0
# Set path to a HVSC-compatible database (if not set, database is disabled).
#SidPlay2_Database
# Sampling Frequency (4000-48000Hz).
#SidPlay2_Frequency = 44100
# Sampling Resolution (8/16).
#SidPlay2_Bits = 16
# Playback Mode:
# "M": Mono (best for many SIDs).
# "S": Stereo.
# "L"/"R": Left / Right.
#SidPlay2_PlayMode = "M"
# Optimisation-level (0-2), 0 is best quality.
#SidPlay2_Optimisation = 0
# Use start-song information from SID (1) or start at first song (0).
# Songs before the start-song won't be played.
#SidPlay2_StartAtStart = 1
# Play sub-tunes.
#SidPlay2_PlaySubTunes = 1
# OnSongChange.
# Specify the full path (i.e. no ~) of an executable to run.
# Arguments will be passed, and you can use the following escapes:
# %a artist
# %r album
# %f filename
# %t title
# %n track
# %d file duration in XX:YY form
# %D file duration, number of seconds
#
# No pipes/redirects can be used directly, but writing a shell
# script can do the job.
#
# Example:
#
#OnSongChange = "/home/jack/.moc/myscript_on_change"
# OnStop.
# Run the following command (full path, no arguments) when MOC changes state
# to stopped (when user stopped playing or changes a song).
#
#OnStop = "/home/jack/.moc/myscript_on_stop"
# This options determines what song to play after finishing all the songs in
# queue. Setting this to 'yes' causes MOC to play the song which follows the
# song played before playing the queue. If set to 'no', MOC will play the song
# after the last song in the queue if it was in the playlist. The default is
# 'yes' because this is the way other players usually behave. (Note that this
# option previously took the values 1 and 0; these are now deprecated in
# favour of 'yes' and 'no'.)
#QueueNextSongReturn = yes
4. Подготовка плейлистов
Для прослушивания музыки вам понадобится как минимум один плейлист. Вы можете использовать m3u файл от других плееров, с интернет-радио, либо создать новый с помощью moc. Для этого в терминале вводим mocp, в открывшемся окне выбираем нужные файлы и папки, для добавления папки в плейлист нажимаем A (латинская a с шифтом), а для файла - a (без шифта). Таким образом появится файл playlist.m3u в папке ~/.moc (вы ведь ещё не закрыли эту папку после создания в ней файла config?). Если вы хотите использовать несколько плейлистов, назовите остальные как playlist01.m3u; playlist02.m3u; etc., и положите их в эту же папку.
5. Создание необходимых скриптов
Нам понадобятся 4 скрипта: для запуска, выбора следующего списка воспроизведения, вывода информации о дорожке и перехода на следующую/предыдущую дорожку. Обращаю Ваше внимание на то, что отсутствующие арты для альбомов будут загружены из интернета и сохранятся в папке ~/.moc/pic/. Скрипты можно сохранять куда угодно и под любым именем, главное - дать права на исполнение (свойства файла - права - позволять выполнение файла как программы)
#!/bin/bash
if [[ $(mocp -i | grep PLAY) ]]
then
{
icon_default='/usr/share/icons/gnome/256x256/mimetypes/sound.png'
title=$(mocp -i | grep ^Title | sed 's|�||g;s|Title: ||g;s|\[.*\]||g;s|(.*)||g;s|, заказал.*$||g;s|^[0-9]* *-* *||g;s|^ - ||g')
if [[ ! $(echo $title | grep [ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzА-Яа-я]) ]]
then
title=$(mocp -i | grep ^File | sed 's|�||g;s|File: ||;s|\[.*\]||g;s|(.*)||g;s|^.*\/||g;s|^[0-9]* *-* *||g;s|.mp3||g;s|^ - ||g')
fi
if [[ ! $(mocp -i | grep "File: http") ]]
then
{
total=$(mocp -i | grep TotalSec | sed 's|^.*: ||g')
current=$(mocp -i | grep CurrentSec | sed 's|^.*: ||g')
length=25
for (( i=1; i <= $length; i++ )); do
[ "$i" -le "$(( $current * $length / $total ))" ] && progress="$progress"█ || progress="$progress"▒
done
}
else
progress=' '
fi
if [[ $title ]]
then
wget -q -t 0 -O - "http://127.0.0.1:8091/'$icon_default' '$title' '$progress'"
fi
picinfostr=$(grep "$title" ~/.moc/picinfo | sed 's|[^%]*%||')
if [[ $picinfostr ]]
then
{
title=$(echo $picinfostr | sed 's|%.*$||')
icon=$(echo $picinfostr | sed 's|^[^%]*%||')
}
else
{
rtitle=$title
if [[ $(mocp -i | grep radionami) ]]
then
{
path=$(wget -t 1 --connect-timeout=3 -q -O- radionami.ru/jax_autoupdate.php | grep album_art | sed 's|^.*album_art/||g;s|.".*$||g')
if [[ $path && ! -e ~/.moc/pic/nami/$path ]]
then
wget -t 1 --connect-timeout=3 -q http://radionami.ru/album_art/$path -P ~/.moc/pic/nami/
fi
if [[ $path ]]
then
icon=~/.moc/pic/nami/$path
fi
}
else
{
if [[ ! $(mocp -i | grep "File: http") ]]
then
icon=$(mocp -i | grep ^File | sed 's|File: ||;s|[^/]*$|folder.jpg|')
fi
if [[ ! -e $icon ]]
then
icon=""
fi
}
fi
if [[ ! $icon ]]
then
{
path=$(wget -t 1 --connect-timeout=3 -q -O- "http://www.lastfm.ru/search?q=$(echo $title | sed 's| |+|g')&from=ac" | grep "\"126\"" | sed 's|^.*src=.||g;s|jpg.*$|jpg|g;s|png.*$|png|g')
if [[ $path ]]
then
localpath=$(echo $path | sed 's|^.*/||g')
fi
if [[ $localpath && ! -e ~/.moc/pic/lastfm/$localpath ]]
then
wget -t 1 --connect-timeout=3 -q $path -P ~/.moc/pic/lastfm/
fi
if [[ $localpath ]]
then
icon=~/.moc/pic/lastfm/$localpath
fi
}
fi
if [[ $icon ]]
then
echo $title%$rtitle%$icon >> ~/.moc/picinfo
else
icon=$icon_default
fi
}
fi
}
else
{
title="Воспроизведение приостановлено"
icon=/usr/share/icons/gnome/256x256/status/stock_volume-mute.png
}
fi
if [[ $title ]]
then
wget -q -t 0 -O - "http://127.0.0.1:8091/'$icon' '$title' ' '"
fi
exit 0
#!/bin/bash
s=$(mocp --info | grep State | sed 's/State: //gi')
if [ "$s" == "PLAY" ] || [ "$s" == "PAUSE" ]; then
mocp --stop
fi
cd ~/.moc/
mv playlist.m3u playlist99.m3u
mv playlist01.m3u playlist.m3u
i=1; ls playlist??.m3u | while read ; do mv "$REPLY" "playlist$(printf %02u $i).m3u" ; ((i++)) ; done
if [ "$s" == "PLAY" ]; then
mocp --play
fi
exit 0
#!/bin/bash
case "$(mocp --info | grep State | sed 's/State: //gi')" in
PLAY|PAUSE) mocp --unpause ;;
STOP) mocp --play ;;
*) mocp --server && mocp --play ;;
esac
#!/bin/bash
if [[ ! $(mocp -i | grep "File: http") ]]
then
$1
else
notify-send -i /usr/share/icons/gnome/256x256/status/dialog-warning.png -u normal -t 2000 "Действие не поддерживается" "Это не локальный плейлист"
fi
exit 0
после того, как мы дали скриптам права на исполнение, переходим к следующему шагу.
6. Добавление кнопок на панель.
Сначала добавим кнопку play/pause.
gnome-session-properties
В открывшемся окне выбираем "добавить", вписываем любое имя и следующую команду:
gtrayicon --activate=TOGGLE --deactivate='mocp --pause' --activate-icon=/usr/share/icons/gnome/24x24/actions/media-playback-start.png --deactivate-icon=/usr/share/icons/gnome/24x24/actions/media-playback-pause.png --tooltip='Запустить/Приостановить воспроизведение'
Примечание: здесь и далее словами INFO, CHANGE, TOGGLE и IFLOCAL обозначены полные пути к приведённым выше скриптам (например, если вы сохранили скрипт toggle в домашней папке под именем script1, то слово TOGGLE в моей команде должно быть заменено на ~/script1)Нажимаем "сохранить". При следующем входе в систему в трее появится иконка запуска плеера.
Теперь добавим остальные кнопки. Жмём правой кнопкой на панели, выбираем "добавить на панель", далее "пользовательская кнопка запуска", там вписываем такие параметры (для каждой пары параметров добавляем новую кнопку запуска):
а. Имя - "Информация о дорожке", Команда: INFO (заменяем на путь к скрипту info)
б. Имя - "Выбрать следующий список воспроизведения", Команда: CHANGE
в. Имя - "Предыдущий трек", Команда: IFLOCAL "mocp --prev"
г. Имя - "Предыдущий трек", Команда: IFLOCAL "mocp --next"
Теперь можно подобрать к кнопкам иконки в соответствии со своей темой оформления
7. Последний шаг. Те, кто пропустил установку notify-osd, пропускают и его.
Настройка notify-osd описана
здесь. Для внешнего вида уведомления как на скриншоте конфиг должен быть таким:
slot-allocation = dynamic
bubble-expire-timeout = 10sec
bubble-vertical-gap = 5px
bubble-horizontal-gap = 100px
bubble-corner-radius = 37,5%
bubble-icon-size = 64px
bubble-gauge-size = 6px
bubble-width = 320px
bubble-background-color = ffffff
bubble-background-opacity = 70%
text-margin-size = 10px
text-title-size = 100%
text-title-weight = bold
text-title-color = 222222
text-title-opacity = 100%
text-body-size = 90%
text-body-weight = normal
text-body-color = 555555
text-body-opacity = 100%
text-shadow-opacity = 0%
В общем то и всё. Благодарю за помощь в создании скриптов жителей этого форума, отдельная благодарность человеку с ником kom3s за прогрессбар. Все вопросы и предложения можете писать в этой теме