Created
December 15, 2019 23:04
-
-
Save jrfoell/0e7473d370fdfc8c614d603a378c3675 to your computer and use it in GitHub Desktop.
Nautilus extension to remap keyboard shortcuts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
# Based on BackspaceBack.py https://github.com/riclc/nautilus_backspace | |
# originally by Ricardo Lenz riclc@hotmail.com | |
# | |
import os, gi | |
gi.require_version('Nautilus', '3.0') | |
from gi.repository import GObject, Nautilus, Gtk, Gio, GLib | |
def ok(): | |
app = Gtk.Application.get_default() | |
app.set_accels_for_action( "view.select-all", ["<super>a"] ) | |
app.set_accels_for_action( "win.undo", ["<super>z"] ) | |
app.set_accels_for_action( "win.redo", [ "<shift><super>z" ] ) | |
app.set_accels_for_action( "view.cut", ["<super>x"] ) | |
app.set_accels_for_action( "view.copy", ["<super>c"] ) | |
app.set_accels_for_action( "view.paste", ["<super>v"] ) | |
class KeybindingRemap(GObject.GObject, Nautilus.LocationWidgetProvider): | |
def __init__(self): | |
pass | |
def get_widget(self, uri, window): | |
ok() | |
return None |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment