Skip to content

Commit fd848a5

Browse files
committed
add help page which shows keybindings
1 parent f095240 commit fd848a5

File tree

4 files changed

+36
-2
lines changed

4 files changed

+36
-2
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ spotify-lyrics
4343
| Next | <kbd>n</kbd> |
4444
| Prev | <kbd>p</kbd> |
4545
| Update Lyrics | <kbd>d</kbd> |
46+
| Help | <kbd>h</kbd> |
4647
| Quit Program | <kbd>q</kbd> |
4748

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

5557
### Example Use Case (i3wm)
5658
```i3

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
long_description = f.read()
99

1010
setup(name='yet-another-spotify-lyrics',
11-
version='2.1.1',
11+
version='2.2.1',
1212
description='Command Line Spotify Lyrics with Album Cover',
1313
author='Göktuğ Karakaşlı',
1414
author_email='[email protected]',
@@ -17,7 +17,7 @@
1717
long_description_content_type='text/markdown',
1818
url='https://github.com/goktug97/yet-another-spotify-lyrics',
1919
download_url=(
20-
'https://github.com/goktug97/yet-another-spotify-lyrics/archive/v2.1.1.tar.gz'),
20+
'https://github.com/goktug97/yet-another-spotify-lyrics/archive/v2.2.1.tar.gz'),
2121
py_modules=[os.path.splitext(os.path.basename(path))[0]
2222
for path in ['spotify_lyrics',
2323
'utils',

spotify_lyrics.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,15 @@ def main(self, canvas):
170170
self.spotify.prev()
171171
elif key == 't':
172172
self.spotify.toggle()
173+
elif key == 'h':
174+
os.system('clear')
175+
album_cover.visibility = ueberzug.Visibility.INVISIBLE
176+
utils.move_cursor(0, start_row)
177+
utils.print_help()
178+
time.sleep(2)
179+
self.print_metadata()
180+
album_cover.visibility = ueberzug.Visibility.VISIBLE
181+
173182

174183
def main():
175184
Lyrics().main()

utils.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,26 @@ def prev(self):
9191

9292
def toggle(self):
9393
self.player_interface.PlayPause()
94+
95+
def print_help():
96+
print(boldify('''
97+
| Action | Keybinding |
98+
|:-------------:|:------------:|
99+
| Scrool Up | k |
100+
| Scrool Down | j |
101+
| Edit Lyrics | e |
102+
| Refresh | r |
103+
| Toggle | t |
104+
| Next | n |
105+
| Prev | p |
106+
| Update Lyrics | d |
107+
| Help | h |
108+
| Quit Program | q |
109+
110+
- Edit Lyrics: Open lyrics in `$EDITOR`.
111+
- Refresh: Refresh lyrics and song metadata.
112+
- Toggle: Play or Pause currently playing song.
113+
- Next: Play next song.
114+
- Prev: Play previous song.
115+
- Update Lyrics: Deletes cached lyrics and fetches lyrics from the internet.
116+
- Help: Show keybindings 2 seconds.'''))

0 commit comments

Comments
 (0)