TUIJam seeks to make a simple, attractive, terminal-based interface to listening to music for Google Play Music All-Access subscribers.
To install from source
git clone git@github.com:cfangmeier/tuijam.git
cd tuijam
python setup.py install --user
or from pypi
pip install --user tuijam
or from the AUR
yay -S tuijam # mainline
yay -S tuijam-git # dev build
The first time TUIJam runs, it will perform an OAuth handshake with Google. Tokens are then stored locally and subsequent logins should be automatic.
Local configuration is stored in $HOME/.config/tuijam/config.yaml
.
persist_queue
: (Default: True
) Saves the current queue and reloads it when the app resumesreverse_scrolling
: (Default: False
) Switches the direction of mouse scrollingYou can customize the visual theme of TUIJam by specifying the foreground/background colors of many of the UI elements in your configuration file. You can specify named colors to use your terminal colorscheme or use #RGB
for custom colors. The default values are listed below.
palette:
header: ["white,underline", "default"]
search-normal: ["white", "default"]
search-select: ["white", "dark red"]
region_bg-normal: ["light gray", "default"]
region_bg-select: ["white", "default"]
progress: ["white", "dark red"]
progress_remaining: ["white", "dark gray"]
TUIJam supports a subset of the MPRIS spec to allow for external control via clients such as playerctl. Currently, the following behavior is supported:
If this causes problems for you, please feel free to create an issue, but this feature can also be disabled by placing the following line in your config file:
mpris_enabled: false
From version 0.3.0, Youtube videos are included in search results. By default, no video is shown during playback, but this can be changed by adding the following line to the config file:
video: true
The player supports Last.fm scrobbling. To enable it, you need to run:
tuijam configure_last_fm
Youtube and Last.fm integration uses api keys that are supplied by me. TUIJam queries them at runtime from a server that I maintain. If the server goes down, of if you would just prefer not to rely on it, you can specify your own keys in the config file. Keys are only queried if they are not present in the config file.
GOOGLE_DEVELOPER_KEY: "yourdeveloperkeyhere"
LASTFM_API_KEY: "yourapikeyhere"
LASTFM_API_SECRET: "yoursecrethere"
You can also run your own server using or adapting key_server_example.py
and setting your config file to point to your server.
key_server: "https://my-tuijam-key-server.io"
The default control keys are listed below with short descriptions. However, many of these can be overridden by specifying alternative keys in the configuration file.
ctrl-c
quitctrl-p
toggle play/pausectrl-k
stopctrl-q
add all songs in search result to queuectrl-n
/right
move to next songctrl-b
/left
move to previous songctrl-r
view recently played songsctrl-w
Clear the current queuectrl-s
shuffle queued songs (Note: If this hangs, try running stty -ixon
in your terminal and restarting tuijam
)ctrl-u
Thumbs up the currently playing songctrl-d
Thumbs down the currently playing song>
/shift-right
seek forward 10 seconds<
/shift-left
seek backwards 10 seconds+
volume up-
volume downtab
/shift-tab
cycle focus through search/queue/input windows\
/ctrl-f
move to search barq
Add selected song/album to queueshift-q
Add selected song/album to the top of queue (play next)r
Create radio station around selected song/album/artist and add 50 songs from it to queuee
view information about selected song/album/artistbackspace
go back in search/expand historyu
/shift-up
move selected song up in queued
/shift-down
move selected song down in queueshift-u
/v
/ctrl-up
move selected song to the top in queueshift-d
/ctrl-down
move selected song to the bottom in queuedelete
/x
remove selected song from queueTo customize these keys, add as many of the following entries into your config file as you want. A list indicates that multiple keys are assigned to that action.
controls:
queue: "q"
queue_next: "Q"
expand: ["e", "enter"]
back: "backspace",
radio: "r",
# queue panel
swap_up: ["u", "shift up"],
swap_down: ["d", "shift down"],
to_top: ["U", "ctrl up"],
to_bottom: ["D", "ctrl down"],
remove: ["delete", "x"],
play_pause: " ",
# search and queue panel
down: "j",
up: "k",
expand: ["e", "enter"],
seek_pos: [">", "shift right"],
seek_neg: ["<", "shift left"],
vol_up: ["+", "="],
vol_down: ["-", "_"],
focus_search: ["ctrl f", "/"],
# global inputs
# Avoid single letter/number/symb keys to work with search input focused, unless vim-mode is active.
g_focus_next: "tab",
g_focus_prev: "shift tab",
g_play_pause: "ctrl p",
g_stop: "ctrl k",
g_play_next: ["ctrl n", "right"],
g_play_previous: ["ctrl b", "left"],
g_recent: "ctrl r",
g_shuffle: "ctrl s",
g_rate_good: "ctrl u",
g_rate_bad: "ctrl d",
g_clear_queue: "ctrl w",
g_queue_all: "ctrl q",
There is an experimental "vim mode" which can be enabled by adding vim_mode: true
to your config file. With this mode enabled, pressing escape will mask keys from being typed into the search bar (press i
to re-enable typing). This makes it more convenient to have single key commands for controlling playback (e.g. instead of ctrl-n
for next song, simply n
).
TUIJam supports translations! It has only English and Russian for now, but you can make your own ones.
You can grab .pot file from the repo (tuijam/lang
folder) and work with it or:
python setup.py extract_messages
to generate .pot filepython setup.py init_catalog -l <LOCALE_CODE>
to generate a new locale.python setup.py update_catalog -l <LOCALE_CODE> -o <LOCALE_PATH>
python setup.py compile_catalog
.<LOCALE_CODE>
is ICU locale ID
User locales are supported. Copy generated .mo files to $HOME/.config/tuijam/lang/
The player's locale can be overridden by launching with LC_ALL environment variables. (LC_ALL="en_US.UTF-8" tuijam
)
TUIJam uses Babel for locale generation. You can look its docs for further information.
TUIJam was heavily inspired by the gpymusic project, and, of course, could not exists without the great gmusicapi.
This project is neither affiliated with nor endorsed by Google.