Skip to content

Instantly share code, notes, and snippets.

@jrfoell
Created December 15, 2019 23:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jrfoell/0e7473d370fdfc8c614d603a378c3675 to your computer and use it in GitHub Desktop.
Save jrfoell/0e7473d370fdfc8c614d603a378c3675 to your computer and use it in GitHub Desktop.
Nautilus extension to remap keyboard shortcuts
#!/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