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 config import MAX_LEN
script = Courses().current.notes
lectures = script.lectures
notes = Courses().current.notes
lectures = notes.lectures
sorted_lectures = sorted(lectures, key=lambda l: -l.number)
@ -24,11 +24,17 @@ key, index, selected = rofi('Select lecture', options, [
'-lines', 5,
'-markup-rows',
'-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:
sorted_lectures[index].edit()
elif key == 1:
new_lecture = script.new_lecture()
new_lecture = notes.new_lecture()
new_lecture.edit()
elif key == 2:
notes.edit_master()
elif key == 3:
notes.edit_full()