pulsemixer-emacs-keybindings.patch 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
  2. This patch changes keybindings to Emacs like.
  3. ---
  4. --- a/pulsemixer 1970-01-01 03:00:01.000000000 +0300
  5. +++ b/pulsemixer 2018-01-23 03:10:21.279134194 +0300
  6. @@ -1565,7 +1565,7 @@
  7. if side is Bar.NONE:
  8. continue
  9. - if c == curses.KEY_UP or c == ord('k'):
  10. + if c == curses.KEY_UP or c == ord('p'):
  11. if bar.locked:
  12. if self.data[focus][1] == 0:
  13. n = 1
  14. @@ -1576,7 +1576,7 @@
  15. self.scroll(self.UP)
  16. if not self.data[self.top_line_num + self.focus_line_num][0]:
  17. self.scroll(self.UP)
  18. - elif c == curses.KEY_DOWN or c == ord('j'):
  19. + elif c == curses.KEY_DOWN or c == ord('n'):
  20. if bar.locked:
  21. if self.data[focus][1] == self.data[focus][3] - 1:
  22. n = 1
  23. @@ -1592,13 +1592,13 @@
  24. bar.mute_toggle()
  25. elif c == self.SPACE_KEY:
  26. bar.lock_toggle()
  27. - elif c == curses.KEY_LEFT or c == ord('h') or any([c & i for i in self.SCROLL_DOWN]):
  28. + elif c == curses.KEY_LEFT or c == ord('b') or any([c & i for i in self.SCROLL_DOWN]):
  29. bar.move(-1, side)
  30. - elif c == curses.KEY_RIGHT or c == ord('l') or any([c & i for i in self.SCROLL_UP]):
  31. + elif c == curses.KEY_RIGHT or c == ord('f') or any([c & i for i in self.SCROLL_UP]):
  32. bar.move(1, side)
  33. - elif c == curses.KEY_SLEFT or c == ord('H'):
  34. + elif c == curses.KEY_SLEFT or c == ord('B'):
  35. bar.move(-10, side)
  36. - elif c == curses.KEY_SRIGHT or c == ord('L'):
  37. + elif c == curses.KEY_SRIGHT or c == ord('F'):
  38. bar.move(10, side)
  39. elif c in self.DIGITS:
  40. percent = int(chr(c)) * 10
  41. @@ -1610,9 +1610,9 @@
  42. self.submenu_show = False
  43. self.focus_line_num = self.modes[5][1]
  44. self.top_line_num = self.modes[5][2]
  45. - elif c == curses.KEY_UP or c == ord('k'):
  46. + elif c == curses.KEY_UP or c == ord('p'):
  47. self.scroll(self.UP)
  48. - elif c == curses.KEY_DOWN or c == ord('j'):
  49. + elif c == curses.KEY_DOWN or c == ord('n'):
  50. self.scroll(self.DOWN)
  51. elif c == ord('\n'):
  52. focus = self.focus_line_num + self.top_line_num
  53. @@ -1847,8 +1847,8 @@
  54. self.screen.refresh()
  55. def display_helpwin(self):
  56. - '''h/j/k/l, arrows navigation, volume change
  57. - H/L, Shift+Left/Shift+Right change volume by 10
  58. + '''b/n/p/f, arrows navigation, volume change
  59. + B/F, Shift+Left/Shift+Right change volume by 10
  60. 1/2/3/4/5/6/7/8/9/0 set volume to 10%-100%
  61. m mute/unmute
  62. Space lock/unlock channels together