Compare commits
No commits in common. "ca78c94e71b36393ab3458375f359ab272d41b70" and "a7be3b1f49e92556ad77721d7ae891c21d40d685" have entirely different histories.
ca78c94e71
...
a7be3b1f49
1 changed files with 7 additions and 24 deletions
|
@ -10,19 +10,10 @@ import shutil
|
||||||
# =======================================================================================
|
# =======================================================================================
|
||||||
|
|
||||||
QPDFVIEW_CONFIGDIR = os.path.expanduser("~/.config/qpdfview/")
|
QPDFVIEW_CONFIGDIR = os.path.expanduser("~/.config/qpdfview/")
|
||||||
if not os.path.exists(QPDFVIEW_CONFIGDIR):
|
|
||||||
print("qpdfview config directory not found.")
|
|
||||||
print("Install qpdfview first and rerun this script.")
|
|
||||||
print("Exiting...")
|
|
||||||
exit(1)
|
|
||||||
|
|
||||||
# =======================================================================================
|
|
||||||
|
|
||||||
QPDFVIEW_CONFIG_CONFIG = QPDFVIEW_CONFIGDIR + "qpdfview.conf"
|
QPDFVIEW_CONFIG_CONFIG = QPDFVIEW_CONFIGDIR + "qpdfview.conf"
|
||||||
print(f"{QPDFVIEW_CONFIG_CONFIG=}")
|
print(f"{QPDFVIEW_CONFIG_CONFIG=}")
|
||||||
|
|
||||||
if os.path.exists(QPDFVIEW_CONFIG_CONFIG):
|
shutil.copyfile(QPDFVIEW_CONFIG_CONFIG, QPDFVIEW_CONFIG_CONFIG + ".orig")
|
||||||
shutil.copyfile(QPDFVIEW_CONFIG_CONFIG, QPDFVIEW_CONFIG_CONFIG + ".orig")
|
|
||||||
|
|
||||||
config = configparser.RawConfigParser()
|
config = configparser.RawConfigParser()
|
||||||
config.optionxform = lambda optionstr: optionstr
|
config.optionxform = lambda optionstr: optionstr
|
||||||
|
@ -32,16 +23,12 @@ config["documentView"]["autoRefresh"] = "true"
|
||||||
config["documentView"]["highlightAll"] = "true"
|
config["documentView"]["highlightAll"] = "true"
|
||||||
config["documentView"]["highlightCurrentThumbnail"] = "true"
|
config["documentView"]["highlightCurrentThumbnail"] = "true"
|
||||||
config["documentView"]["highlightDuration"] = "5000"
|
config["documentView"]["highlightDuration"] = "5000"
|
||||||
config["documentView"]["limitThumbnailsToResults"] = "true"
|
|
||||||
config["documentView"]["prefetch"] = "true"
|
config["documentView"]["prefetch"] = "true"
|
||||||
config["documentView"]["prefetchDistance"] = "5"
|
config["documentView"]["prefetchDistance"] = "5"
|
||||||
config["documentView"]["relativeJumps"] = "true"
|
config["documentView"]["relativeJumps"] = "true"
|
||||||
|
|
||||||
config["mainWindow"]["recentlyClosedCount"] = "20"
|
|
||||||
config["mainWindow"]["recentlyUsedCount"] = "40"
|
|
||||||
config["mainWindow"]["restorePerFileSettings"] = "true"
|
config["mainWindow"]["restorePerFileSettings"] = "true"
|
||||||
config["mainWindow"]["restoreTabs"] = "true"
|
config["mainWindow"]["restoreTabs"] = "true"
|
||||||
config["mainWindow"]["searchableMenus"] = "true"
|
|
||||||
config["mainWindow"]["tabVisibility"] = "0"
|
config["mainWindow"]["tabVisibility"] = "0"
|
||||||
config["mainWindow"]["trackRecentlyUsed"] = "true"
|
config["mainWindow"]["trackRecentlyUsed"] = "true"
|
||||||
config["mainWindow"]["viewToolBar"] = "scaleFactor, zoomIn, zoomOut, fitToPageWidthMode"
|
config["mainWindow"]["viewToolBar"] = "scaleFactor, zoomIn, zoomOut, fitToPageWidthMode"
|
||||||
|
@ -55,18 +42,14 @@ with open(QPDFVIEW_CONFIG_CONFIG, "w") as file:
|
||||||
|
|
||||||
QPDFVIEW_CONFIG_SHORTCUTS = QPDFVIEW_CONFIGDIR + "shortcuts.conf"
|
QPDFVIEW_CONFIG_SHORTCUTS = QPDFVIEW_CONFIGDIR + "shortcuts.conf"
|
||||||
|
|
||||||
if os.path.exists(QPDFVIEW_CONFIG_SHORTCUTS):
|
shutil.copyfile(QPDFVIEW_CONFIG_SHORTCUTS, QPDFVIEW_CONFIG_SHORTCUTS + ".orig")
|
||||||
shutil.copyfile(QPDFVIEW_CONFIG_SHORTCUTS, QPDFVIEW_CONFIG_SHORTCUTS + ".orig")
|
|
||||||
|
|
||||||
shortcut_config = configparser.RawConfigParser()
|
config = configparser.RawConfigParser()
|
||||||
shortcut_config.optionxform = lambda optionstr: optionstr
|
config.optionxform = lambda optionstr: optionstr
|
||||||
shortcut_config.read(QPDFVIEW_CONFIG_SHORTCUTS)
|
config.read(QPDFVIEW_CONFIG_SHORTCUTS)
|
||||||
|
|
||||||
shortcut_config["General"]["continuousMode"] = "Ctrl+7, C"
|
config["General"]["nextPage"] = "Space, N"
|
||||||
shortcut_config["General"]["findNext"] = "Ctrl+G, Return"
|
config["General"]["previousPage"] = "Backspace, P"
|
||||||
shortcut_config["General"]["findPrevious"] = "Ctrl+Shift+G, Shift+Return"
|
|
||||||
shortcut_config["General"]["nextPage"] = "Space, N"
|
|
||||||
shortcut_config["General"]["previousPage"] = "Backspace, P"
|
|
||||||
|
|
||||||
with open(QPDFVIEW_CONFIG_SHORTCUTS, "w") as file:
|
with open(QPDFVIEW_CONFIG_SHORTCUTS, "w") as file:
|
||||||
config.write(file, space_around_delimiters=False)
|
config.write(file, space_around_delimiters=False)
|
||||||
|
|
Loading…
Add table
Reference in a new issue