add shortcut keys for editing master and / or full file

This commit is contained in:
Maximilian Keßler 2021-09-18 13:43:19 +02:00
parent 86bb3babe5
commit 49689e4dd0

View file

@ -4,8 +4,8 @@ from rofi import rofi
from utils import generate_short_title from utils import generate_short_title
from config import MAX_LEN from config import MAX_LEN
script = Courses().current.notes notes = Courses().current.notes
lectures = script.lectures lectures = notes.lectures
sorted_lectures = sorted(lectures, key=lambda l: -l.number) sorted_lectures = sorted(lectures, key=lambda l: -l.number)
@ -24,11 +24,17 @@ key, index, selected = rofi('Select lecture', options, [
'-lines', 5, '-lines', 5,
'-markup-rows', '-markup-rows',
'-kb-row-down', 'Down', '-kb-row-down', 'Down',
'-kb-custom-1', 'Ctrl+n' '-kb-custom-1', 'Alt+n',
'-kb-custom-2', 'Alt+m',
'-kb-custom-3', 'Alt+s'
]) ])
if key == 0: if key == 0:
sorted_lectures[index].edit() sorted_lectures[index].edit()
elif key == 1: elif key == 1:
new_lecture = script.new_lecture() new_lecture = notes.new_lecture()
new_lecture.edit() new_lecture.edit()
elif key == 2:
notes.edit_master()
elif key == 3:
notes.edit_full()