automatically export current hotkeys
This commit is contained in:
@@ -13,6 +13,7 @@ term = 'termite'
|
||||
focus_color = '#bd93f9'
|
||||
border_width = 2
|
||||
mod = 'mod4'
|
||||
hotkey_file='/home/paul/.config/qtile/Hotkeys.csv'
|
||||
|
||||
#region colors
|
||||
light_foreground_color = ['#f8f8f2','#f8f8f2']
|
||||
@@ -45,27 +46,27 @@ cyan_color = ['#8be9fd','#8be9fd']
|
||||
#region Keys
|
||||
keys = [
|
||||
#moving focus aroung
|
||||
Key([mod], "h", lazy.layout.left()),
|
||||
Key([mod], "l", lazy.layout.right()),
|
||||
Key([mod], "j", lazy.layout.down()),
|
||||
Key([mod], "k", lazy.layout.up()),
|
||||
Key([mod,"mod1"], "k", lazy.to_screen(0)),
|
||||
Key([mod,"mod1"], "j", lazy.to_screen(1)),
|
||||
Key([mod,"mod1"], "l", lazy.to_screen(1)),
|
||||
Key([mod,"mod1"], "h", lazy.to_screen(2)),
|
||||
Key([mod], "h", lazy.layout.left(),desc="move focus left"),
|
||||
Key([mod], "l", lazy.layout.right(),desc="move focus right"),
|
||||
Key([mod], "j", lazy.layout.down(),desc="move focus down"),
|
||||
Key([mod], "k", lazy.layout.up(),desc="move focus up"),
|
||||
Key([mod,"mod1"], "k", lazy.to_screen(0),desc="move focus to top screen"),
|
||||
Key([mod,"mod1"], "j", lazy.to_screen(1),desc="move focus to main screen"),
|
||||
Key([mod,"mod1"], "l", lazy.to_screen(1),desc="move focus to main screen"),
|
||||
Key([mod,"mod1"], "h", lazy.to_screen(2),desc="move focus to left screen"),
|
||||
|
||||
# moving windows around
|
||||
Key([mod, "shift"], "h", lazy.layout.swap_left()),
|
||||
Key([mod, "shift"], "l", lazy.layout.swap_right()),
|
||||
Key([mod, "shift"], "j", lazy.layout.shuffle_down()),
|
||||
Key([mod, "shift"], "k", lazy.layout.shuffle_up()),
|
||||
Key([mod, "shift"], "h", lazy.layout.swap_left(),desc="move focused window left"),
|
||||
Key([mod, "shift"], "l", lazy.layout.swap_right(),desc="move focused window right"),
|
||||
Key([mod, "shift"], "j", lazy.layout.shuffle_down(),desc="move focused window down"),
|
||||
Key([mod, "shift"], "k", lazy.layout.shuffle_up(),desc="move focused window up"),
|
||||
|
||||
# resize windows
|
||||
Key([mod], "plus", lazy.layout.grow()),
|
||||
Key([mod], "minus", lazy.layout.shrink()),
|
||||
Key([mod], "n", lazy.layout.normalize()),
|
||||
Key([mod], "o", lazy.layout.maximize()),
|
||||
Key([mod], "space", lazy.window.toggle_fullscreen()),
|
||||
Key([mod], "plus", lazy.layout.grow(),desc="increase window size"),
|
||||
Key([mod], "minus", lazy.layout.shrink(),desc="decrease window size"),
|
||||
Key([mod], "n", lazy.layout.normalize(),desc="normalize windows"),
|
||||
Key([mod], "o", lazy.layout.maximize(),desc="maximize current window"),
|
||||
Key([mod], "space", lazy.window.toggle_fullscreen(),desc="make current window fullscreen"),
|
||||
|
||||
# app hotkeys
|
||||
Key([mod],"t", lazy.spawn(term), desc="Launch terminal"),
|
||||
@@ -583,7 +584,19 @@ cursor_warp = False
|
||||
auto_fullscreen = True
|
||||
focus_on_window_activation = "smart"
|
||||
|
||||
|
||||
#export keys into textfile
|
||||
if os.path.isfile(hotkey_file):
|
||||
os.remove(hotkey_file)
|
||||
with open(hotkey_file,'w') as file:
|
||||
for key in keys:
|
||||
if not str(key.key).startswith("XF86"):
|
||||
modifiers=""
|
||||
for modifier in key.modifiers:
|
||||
modifiers += '{:^7}'.format(
|
||||
str(modifier).replace("mod1","Alt").replace("mod4","Super").replace("shift","Shift").replace("control","Ctrl")
|
||||
) + "+"
|
||||
file.write('{:30}'.format(modifiers+' '+str(key.key).upper())+"=>\t"+key.desc)
|
||||
file.write('\n')
|
||||
|
||||
# XXX: Gasp! We're lying here. In fact, nobody really uses or cares about this
|
||||
# string besides java UI toolkits; you can see several discussions on the
|
||||
|
||||
Reference in New Issue
Block a user