From 52580157b398a50244dccb405360bcc2c2784106 Mon Sep 17 00:00:00 2001 From: Ian Markind Date: Wed, 29 Aug 2018 21:16:01 -0400 Subject: [PATCH] created shortcuts for spectacle, pocket, and bitbucket. edited slack, spotify, std, jetbrains, and phpstorm --- bit-bucket.py | 57 ++++++++++++++++++++++++++++++++++++++++++++++++ google-chrome.py | 7 ++++++ jetbrains.py | 8 ++++--- php-storm.py | 3 ++- pocket.py | 40 +++++++++++++++++++++++++++++++++ slack.py | 3 ++- spectacle.py | 28 ++++++++++++++++++++++++ spotify.py | 2 +- std.py | 28 +++++++++++++++++++----- 9 files changed, 165 insertions(+), 11 deletions(-) create mode 100644 bit-bucket.py create mode 100644 pocket.py create mode 100644 spectacle.py diff --git a/bit-bucket.py b/bit-bucket.py new file mode 100644 index 0000000..75a9c57 --- /dev/null +++ b/bit-bucket.py @@ -0,0 +1,57 @@ +from talon.voice import Context, Key + +ctx = Context('bit-bucket', func=lambda app, win: 'Bitbucket' in win.title) + +keymap = { + # All Pages + + 'shortcuts': Key('?'), + 'left navigation': Key('['), + 'site search': Key('/'), + + # Most Pages (except your work and repository source) + 'omnibar': Key('.'), + 'next item': Key('capslock-j'), + 'last item': Key('capslock-k'), + 'selected': Key('capslock-o'), + '[work] dashboard': Key('capslock-g capslock-d'), + '[bucket] settings': Key('capslock-g capslock-a'), + 'remove focus': Key('esc'), + 'go back': Key('capslock-u'), + 'right navigation': Key(']'), + + # Repository source + 'focus': Key('capslock-f'), + + # Repository pages (except source) + 'create': Key('capslock-c capslock-r'), + 'import': Key('capslock-I capslock-r'), + 'source': Key('capslock-r capslock-s'), + 'view commits': Key('capslock-r capslock-c'), + 'view branches': Key('capslock-r capslock-b'), + 'pull requests': Key('capslock-r capslock-p'), + 'issues': Key('capslock-r capslock-i'), + 'wiki': Key('capslock-r capslock-w'), + 'show downloads': Key('capslock-r capslock-d'), + 'repo settings': Key('capslock-r capslock-a'), + 'find file': Key('capslock-f'), + + # Repository pages (except source and settings) + 'fork repository': Key('capslock-x capslock-f'), + 'create branch': Key('capslock-x capslock-b'), + 'compare': Key('capslock-x capslock-c'), + 'fork repository': Key('capslock-x capslock-f'), + 'create pull request': Key('capslock-x capslock-p'), + 'create issue': Key('capslock-x capslock-i'), + + # Pull Requests + 'submit comment': Key('ctrl+enter'), + 'inline comments': Key('capslock-t capslock-c'), + 'diff tab': Key('capslock-p capslock-d'), + 'commits tab': Key('capslock-p capslock-c'), + 'activity tab': Key('capslock-p capslock-a'), + 'show tasks': Key('shift-capslock-t'), + +} + +ctx.keymap(keymap) diff --git a/google-chrome.py b/google-chrome.py index 61ff50f..1d0f76e 100644 --- a/google-chrome.py +++ b/google-chrome.py @@ -79,6 +79,7 @@ def jump_tab(m): 'search': search, 'print': print_page, 'top': scroll_to_top, + 'clear': [Key('cmd-a'), Key('backspace')], # youtube # disable vimium for youtube shortcuts to work @@ -166,12 +167,15 @@ def jump_tab(m): 'find': Key('cmd-f'), 'next match': Key('cmd-g'), '(last | prevous)': Key('cmd-shift-g'), + '(pushpin | pullpin)': Key('cmd-shift-x'), 'clear cash': Key('cmd-shift-backspace'), # dev tools 'toggle dev tools': Key('cmd-alt-i'), 'command [menu]': Key('cmd-shift-p'), + 'element': Key('cmd-shift-c'), + 'mobile': Key('cmd-shift-m'), '(javascript (counsel | console) | javascript (counsel | console) close)': Key('cmd-alt-j'), 'next panel': next_panel, '(last | prevous) panel': last_panel, @@ -190,4 +194,7 @@ def jump_tab(m): # Clipboard 'paste same style': Key('cmd-alt-shift-v'), + + + }) diff --git a/jetbrains.py b/jetbrains.py index af76c4c..af15e8d 100644 --- a/jetbrains.py +++ b/jetbrains.py @@ -16,10 +16,11 @@ ] -ctx = Context('phpstorm', func=lambda app, win: any( +ctx = Context('jetbrains', func=lambda app, win: any( i in app.bundle for i in ides)) keymap = { + 'clear': [Key('cmd-a'), Key('backspace')], 'comment declaration': ['/**', Key('space')], 'comment block': ['/**', Key('enter')], 'block comment': Key('cmd-alt-/'), @@ -50,7 +51,8 @@ 'grab down': Key('shift-cmd-pagedown'), # 'rename': Key('shift-f6'), 'move file': Key('f6'), - 'global search': Key('shift shift'), + 'file search': Key('shift shift'), + 'global search': Key('cmd-shift-f'), 'go to file': Key('cmd-shift-n'), 'format': Key('cmd-alt-l'), 'expand': Key('cmd-+'), @@ -62,7 +64,7 @@ 'snip right': Key('cmd-shift-right delete'), 'move up': Key('alt-shift-up'), 'move down': Key('alt-shift-down'), - 'path': Key('cmd-shift-f'), + 'path': Key('cmd-shift-f'), 'funk up': Key('cmd-shift-up'), 'funk down': Key('cmd-shift-down'), '(breadcrumbs | crumbs)': Key('cmd-up'), diff --git a/php-storm.py b/php-storm.py index f1009a1..cd8fd88 100644 --- a/php-storm.py +++ b/php-storm.py @@ -27,7 +27,8 @@ 'else markup': ['elsem', Key('tab')], 'complete': Key('cmd-shift-enter'), 'definition': Key('alt-space'), -} + + } ctx.keymap(keymap) diff --git a/pocket.py b/pocket.py new file mode 100644 index 0000000..f43b0e5 --- /dev/null +++ b/pocket.py @@ -0,0 +1,40 @@ +from talon.voice import Context, Key + +ctx = Context('pocket', bundle='com.readitlater.PocketMac') + +keymap = { + # File Menu + 'save keyboard': Key('cmd-s'), + 'refresh': Key('cmd-r'), + 'close window': Key('cmd-w'), + 'print': Key('cmd-p'), + + # Edit Menu + 'tags': Key('t'), + 'save tag': Key('cmd-enter'), + 'undo': Key('cmd-z'), + 'redo': Key('shift-cmd-z'), + + # View Menu + 'next': Key('j'), + 'previous': Key('k'), + 'list home': Key('cmd-1'), + 'list favorites': Key('cmd-2'), + 'list archive': Key('cmd-3'), + 'filter all items': Key('alt-1'), + 'filter articles': Key('alt-2'), + 'filter videos': Key('alt-3'), + 'filter images': Key('alt-4'), + '(web | article) view': Key('cmd-/'), + + # Item Menu + 'archive': Key('a'), + 'favorite': Key('f'), + 'delete': Key('backspace'), + 'copy item': Key('c'), + 'mail item': Key('shift-cmd-i'), + 'open in browser': Key('o'), + 'open in background': Key('cmd-o'), +} + +ctx.keymap(keymap) diff --git a/slack.py b/slack.py index fb78c3c..7230e32 100644 --- a/slack.py +++ b/slack.py @@ -57,13 +57,14 @@ # Calls '([toggle] mute | unmute)': Key('m'), - '([toggle] video)': Key('v'), + '[toggle] video': Key('v'), 'invite': Key('a'), # Emojis 'thumbs up': ':+1:', 'smiley': ':slightly_smiling_face:', 'laugh out loud': ':joy:', + 'shruggie': '/shrug ', # Miscellaneous 'shortcuts': Key('cmd-/'), diff --git a/spectacle.py b/spectacle.py new file mode 100644 index 0000000..25a7ce6 --- /dev/null +++ b/spectacle.py @@ -0,0 +1,28 @@ +from talon.voice import Context, Key + +ctx = Context('spectacle') + +keymap = { + + 'center': Key('alt-cmd-c'), + '(fullscreen | full)': Key('cmd-alt-f'), + 'snapleft': Key('cmd-alt-left'), + 'snapright': Key('cmd-alt-right'), + 'snap up': Key('alt-cmd-up'), + 'snap down': Key('alt-cmd-down'), + 'snap top left': Key('ctrl-cmd-left'), + 'snap bottom left': Key('ctrl-shift-cmd-left'), + 'snap top right': Key('ctrl-cmd-right'), + 'snap bottom right': Key('ctrl-shift-cmd-right'), + 'next display': Key('ctrl-alt-cmd-right'), + 'previous display': Key('ctrl-alt-cmd-left'), + 'next third': Key('ctrl-alt-right'), + 'previous third': Key('ctrl-alt-left'), + 'make larger': Key('ctrl-alt-shift-right'), + 'make smaller': Key('ctrl-alt-shift-left'), + 'speck undo': Key('alt-cmd-z'), + 'speck redo': Key('alt-shift-cmd-z'), + +} + +ctx.keymap(keymap) diff --git a/spotify.py b/spotify.py index 10d8803..f9eae78 100644 --- a/spotify.py +++ b/spotify.py @@ -5,7 +5,7 @@ } -ctx = Context('phpstorm', func=lambda app, win: any( +ctx = Context('spotify', func=lambda app, win: any( i in app.bundle for i in ides)) keymap = { diff --git a/std.py b/std.py index a32b03a..01c4ad6 100644 --- a/std.py +++ b/std.py @@ -168,10 +168,26 @@ def FormatText(m): 'kill': Key('ctrl-c'), # Spectacle - '(fullscreen | full)': Key('cmd-alt-f'), - 'snapleft': Key('cmd-alt-left'), - 'snapright': Key('cmd-alt-right'), - + # '(fullscreen | full)': Key('cmd-alt-f'), + # 'snapleft': Key('cmd-alt-left'), + # 'snapright': Key('cmd-alt-right'), + # 'center': Key('alt-cmd-c'), + # # 'left half': Key('alt-cmd-left'), + # # 'right half': Key('alt-cmd-right'), + # 'tippy half': Key('alt-cmd-up'), + # 'flippy half': Key('alt-cmd-down'), + # 'upper left': Key('ctrl-cmd-left'), + # 'lower left': Key('ctrl-shift-cmd-left'), + # 'upper right': Key('ctrl-cmd-right'), + # 'lower right': Key('ctrl-shift-cmd-right'), + # 'next display': Key('ctrl-alt-cmd-right'), + # 'previous left': Key('ctrl-alt-cmd-left'), + # 'next third': Key('ctrl-alt-right'), + # 'previous third': Key('ctrl-alt-left'), + # 'make larger': Key('ctrl-alt-shift-right'), + # 'make smaller': Key('ctrl-alt-shift-left'), + # 'spec undo': Key('alt-cmd-z'), + # 'spec redo': Key('alt-shift-cmd-z'), 'spotlight': Key('cmd-space'), @@ -320,10 +336,12 @@ def FormatText(m): 'tip double': 'double ', 'args': ['()', Key('left')], - 'index': ['[]', Key('left')], + 'brackets': ['[]', Key('left')], 'block': [' {}', Key('left enter enter up tab')], 'empty array': '[]', 'empty dict | braces': '{}', + # 'brace': [' else if ()', Key('left')], + # python 'state (def | deaf | deft)': 'def ',