gotroller

package module
v0.0.0-...-85d8822 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2023 License: GPL-2.0 Imports: 7 Imported by: 0

README

GOTROLLER

MPRIS controller, with GUI and Polybar integrations.

wrote in go btw.

screenshot

polybar module

screenshot of the gui

waybar module + gui

Features

  • Play/Pause
  • Volume control (scrollling)
  • Playlist control
  • Restart song (right click the previous song button)
  • Player selector
  • GUI with progress bar and thumbnail
  • "Disable" mode

Instalation

First, make sure you have polybar and Font Awesome 5.

Then clone the repository and open it's folder:

git clone https://github.com/Pauloo27/gotroller.git

cd gotroller

If you don't want the GUI you can use dmenu to select the player to be displayed. To do that, run:

make install-cli

If you want the GUI, run (the GUI takes sometime to compile):

make install

You can start the GUI by running gotroller-gui or clicking the "menu" icon in the bar

Now, add gotroller as a module in your ~/.config/polybar/config:

[module/gotroller]
type = custom/script
exec = gotroller polybar-gui
tail = true
interval = 1
format-underline = #8be9fd

If you don't want to use the GUI, change exec = gotroller polybar-gui to exec = gotroller polybar-dmenu

Finally, restart polybar.

Config

You can set the song title and artist max length, if the length is greater than the defined one, it will be limited and "..." will be appended. The default value is 30 (song title) and 20 (artist).

To set it, you can set a system env or just create the file ~/.config/gotroller.env with the following content:

GOTROLLER_MAX_ARTIST_SIZE=20
GOTROLLER_MAX_TITLE_SIZE=30
GOTROLLER_GUI_MAX_ARTIST_SIZE=20
GOTROLLER_GUI_MAX_TITLE_SIZE=30

If the value is 0 or negative, the length will not be limited.

License

GPL Logo

This project is licensed under GNU General Public License v2.0.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Documentation

Index

Constants

View Source
const (
	PLAYING = ""
	PAUSED  = ""
	STOPPED = ""

	PREVIOUS = ""
	NEXT     = ""

	VOLUME = ""

	MENU = ""
)

Font Awesome 5

View Source
const PREFERED_PLAYER_STORE_PATH = "/dev/shm/gotroller-player.txt"

Variables

This section is empty.

Functions

func GetBestPlayer

func GetBestPlayer() (*mpris.Player, error)

GetBestPlayer Returns the "best" player to be displayed. THIS IS NOT CACHED, so avoid calling it twice. The "best" is the one selected by the user. If not players were selected or the selected player isn't running then the best is the first player in the list that isn't "Stopped". If all players are stopped, fallback to the first one in the list.

func GetDbusConn

func GetDbusConn() (*dbus.Conn, error)

GetDbusConn Creates and cache a dbus connection. The cache is used in subsequent calls.

func GetPreferedPlayerName

func GetPreferedPlayerName() (string, error)

func HideGotroller

func HideGotroller() error

func ListPlayersName

func ListPlayersName() ([]string, error)

func ListenToChanges

func ListenToChanges(ch chan fsnotify.Event) error

func RemovePreferedPlayerName

func RemovePreferedPlayerName() error

func SetPreferedPlayerName

func SetPreferedPlayerName(name string) error

Types

type ErrDisabled

type ErrDisabled struct{}

func (ErrDisabled) Error

func (e ErrDisabled) Error() string

Directories

Path Synopsis
cli
gui

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL