Skip to content

Commit

Permalink
Add support for previous and next track buttons on Linux
Browse files Browse the repository at this point in the history
Updated prevtrack and nexttrack function to handle Linux-specific key events
  • Loading branch information
Lenochxd committed Dec 15, 2024
1 parent 27051fd commit 980bf2b
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions app/buttons/audio/media.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,25 @@ def playpause():
keyboard.send(-179)

def prevtrack():
pyautogui.press("prevtrack")
try:
if is_linux:
keyboard.send("previous track")
else:
pyautogui.press("prevtrack")
except:
if is_linux:
keyboard.send(165)
else:
keyboard.send(-177)

def nexttrack():
pyautogui.press("nexttrack")
try:
if is_linux:
keyboard.send("next track")
else:
pyautogui.press("nexttrack")
except:
if is_linux:
keyboard.send(163)
else:
keyboard.send(-176)

0 comments on commit 980bf2b

Please sign in to comment.