Skip to content

Commit

Permalink
osc.lua: open the playlist selector when right clicking playlist arrows
Browse files Browse the repository at this point in the history
- It makes more sense to select a playlist entry from the buttons that
  navigate the playlist than from the title
- Provides different bindings for right and middle click
- Mirrors chapter button bindings
  • Loading branch information
guidocella committed Dec 12, 2024
1 parent f4a35a0 commit 97380dd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
8 changes: 4 additions & 4 deletions DOCS/man/osc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@ The Interface
pl prev
============= ================================================
left-click play previous file in playlist
right-click show the playlist
shift+L-click show the playlist
middle-click show the playlist
right-click open the playlist selector
============= ================================================

pl next
============= ================================================
left-click play next file in playlist
right-click show the playlist
shift+L-click show the playlist
middle-click show the playlist
right-click open the playlist selector
============= ================================================

title
Expand Down Expand Up @@ -505,13 +505,13 @@ clicked. ``mbtn_mid`` commands are also triggered with ``shift+mbtn_left``.

``playlist_prev_mbtn_mid_command=show-text ${playlist} 3000``

``playlist_prev_mbtn_right_command=show-text ${playlist} 3000``
``playlist_prev_mbtn_right_command=script-binding select/select-playlist; script-message-to osc osc-hide``

``playlist_next_mbtn_left_command=playlist-next; show-text ${playlist} 3000``

``playlist_next_mbtn_mid_command=show-text ${playlist} 3000``

``playlist_next_mbtn_right_command=show-text ${playlist} 3000``
``playlist_next_mbtn_right_command=script-binding select/select-playlist; script-message-to osc osc-hide``

``title_mbtn_left_command=script-binding stats/display-page-5``

Expand Down
3 changes: 3 additions & 0 deletions etc/restore-osc-bindings.conf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ chapter_prev_mbtn_left_command=no-osd add chapter -1; show-text ${chapter-list}
chapter_next_mbtn_left_command=no-osd add chapter 1; show-text ${chapter-list} 3000

# restore behavior before select.lua usage
playlist_prev_mbtn_left_command=show-text ${playlist} 3000
playlist_next_mbtn_left_command=show-text ${playlist} 3000

title=${media-title}
title_mbtn_left_command=show-text "${!playlist-count==1:[${playlist-pos-1}/${playlist-count}] }${media-title}"
title_mbtn_right_command=show-text ${filename}
Expand Down
4 changes: 2 additions & 2 deletions player/lua/osc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ local user_opts = {
-- luacheck: max line length
playlist_prev_mbtn_left_command = "playlist-prev",
playlist_prev_mbtn_mid_command = "show-text ${playlist} 3000",
playlist_prev_mbtn_right_command = "show-text ${playlist} 3000",
playlist_prev_mbtn_right_command = "script-binding select/select-playlist; script-message-to osc osc-hide",

playlist_next_mbtn_left_command = "playlist-next",
playlist_next_mbtn_mid_command = "show-text ${playlist} 3000",
playlist_next_mbtn_right_command = "show-text ${playlist} 3000",
playlist_next_mbtn_right_command = "script-binding select/select-playlist; script-message-to osc osc-hide",

title_mbtn_left_command = "script-binding stats/display-page-5",
title_mbtn_mid_command = "show-text ${filename}",
Expand Down

0 comments on commit 97380dd

Please sign in to comment.