Skip to content

Commit 60caa03

Browse files
committed
add usage gif and new example
1 parent 968e89d commit 60caa03

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ python setup.py install --user
2525
```
2626

2727
## Usage
28+
![Usage Gif](https://raw.githubusercontent.com/goktug97/yet-another-spotify-lyrics/master/usage.gif)
2829

2930
``` bash
3031
spotify-lyrics
@@ -58,6 +59,22 @@ for_window [instance="Lyrics"] floating enable; [instance="Lyrics"] move positio
5859
for_window [instance="Lyrics"] resize set 644 388
5960
```
6061

62+
### Example Use Case (Emacs)
63+
Open the lyrics in a buffer.
64+
65+
``` emacs-lisp
66+
(defun spotify-lyrics ()
67+
(interactive)
68+
(let ((string (shell-command-to-string "spotify-lyrics-once")))
69+
(get-buffer-create "lyrics-buffer")
70+
(switch-to-buffer-other-window "lyrics-buffer")
71+
(with-current-buffer "lyrics-buffer"
72+
(goto-char (point-max))
73+
(erase-buffer)
74+
(insert string)
75+
(goto-line 1))))
76+
```
77+
6178
### Example Use Case (Conky)
6279
You can use spotify-lyrics-once to output the lyrics to the stdout and exit.
6380
If you have program that utilizes stdin, you can use this version.

usage.gif

15.3 MB
Loading

0 commit comments

Comments
 (0)