Skip to content

Commit

Permalink
add help page which shows keybindings
Browse files Browse the repository at this point in the history
  • Loading branch information
goktug97 committed Dec 19, 2019
1 parent f095240 commit fd848a5
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ spotify-lyrics
| Next | <kbd>n</kbd> |
| Prev | <kbd>p</kbd> |
| Update Lyrics | <kbd>d</kbd> |
| Help | <kbd>h</kbd> |
| Quit Program | <kbd>q</kbd> |

- Edit Lyrics: Open lyrics in `$EDITOR`.
Expand All @@ -51,6 +52,7 @@ spotify-lyrics
- Next: Play next song.
- Prev: Play previous song.
- Update Lyrics: Deletes cached lyrics and fetches lyrics from the internet.
- Help: Show keybindings 2 seconds.

### Example Use Case (i3wm)
```i3
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
long_description = f.read()

setup(name='yet-another-spotify-lyrics',
version='2.1.1',
version='2.2.1',
description='Command Line Spotify Lyrics with Album Cover',
author='Göktuğ Karakaşlı',
author_email='karakasligk@gmail.com',
Expand All @@ -17,7 +17,7 @@
long_description_content_type='text/markdown',
url='https://github.com/goktug97/yet-another-spotify-lyrics',
download_url=(
'https://github.com/goktug97/yet-another-spotify-lyrics/archive/v2.1.1.tar.gz'),
'https://github.com/goktug97/yet-another-spotify-lyrics/archive/v2.2.1.tar.gz'),
py_modules=[os.path.splitext(os.path.basename(path))[0]
for path in ['spotify_lyrics',
'utils',
Expand Down
9 changes: 9 additions & 0 deletions spotify_lyrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,15 @@ def main(self, canvas):
self.spotify.prev()
elif key == 't':
self.spotify.toggle()
elif key == 'h':
os.system('clear')
album_cover.visibility = ueberzug.Visibility.INVISIBLE
utils.move_cursor(0, start_row)
utils.print_help()
time.sleep(2)
self.print_metadata()
album_cover.visibility = ueberzug.Visibility.VISIBLE


def main():
Lyrics().main()
Expand Down
23 changes: 23 additions & 0 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,26 @@ def prev(self):

def toggle(self):
self.player_interface.PlayPause()

def print_help():
print(boldify('''
| Action | Keybinding |
|:-------------:|:------------:|
| Scrool Up | k |
| Scrool Down | j |
| Edit Lyrics | e |
| Refresh | r |
| Toggle | t |
| Next | n |
| Prev | p |
| Update Lyrics | d |
| Help | h |
| Quit Program | q |
- Edit Lyrics: Open lyrics in `$EDITOR`.
- Refresh: Refresh lyrics and song metadata.
- Toggle: Play or Pause currently playing song.
- Next: Play next song.
- Prev: Play previous song.
- Update Lyrics: Deletes cached lyrics and fetches lyrics from the internet.
- Help: Show keybindings 2 seconds.'''))

0 comments on commit fd848a5

Please sign in to comment.