From 24961625dcf34adf62ef1c40651cfd99ae5d511f Mon Sep 17 00:00:00 2001 From: Guilherme Rugai Freire Date: Wed, 1 Jun 2022 14:03:17 -0300 Subject: [PATCH] use hotkey deamon for wm agnostic applications --- .config/nvim/init.vim | 1 + .config/qtile/config.py | 47 +++++------------------------------------ .config/sxhkd/sxhkdrc | 32 ++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 42 deletions(-) create mode 100644 .config/sxhkd/sxhkdrc diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index a3da1fb..49c4d5a 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -23,6 +23,7 @@ Plug 'preservim/nerdtree' Plug 'Xuyuanp/nerdtree-git-plugin' Plug 'ryanoasis/vim-devicons' Plug 'tiagofumo/vim-nerdtree-syntax-highlight' +Plug 'kovetskiy/sxhkd-vim' set encoding=UTF-8 diff --git a/.config/qtile/config.py b/.config/qtile/config.py index f9ea5e9..358725c 100644 --- a/.config/qtile/config.py +++ b/.config/qtile/config.py @@ -11,39 +11,18 @@ from libqtile.lazy import lazy MOD = "mod4" ALT = "mod1" TERMINAL = "alacritty" -LAUNCHER = "rofi -icon-theme 'Paper' -show-icons -show drun" -WEB = "firefox" FILE_MANAGER = "pcmanfm --no-desktop -n" -CLIPBOARD_MANAGER = "rofi -modi \"clipboard:greenclip print\" -show clipboard -run-command '{cmd}'" -PASSWORD_MANAGER = "bitwarden-desktop" SCREENSHOT = "gnome-screenshot" SCREENSHOT_UTILITY = "gnome-screenshot -i" -ZOOM_UTILITY = "boomer" CALCULATOR = "gnome-calculator" CALENDAR = "gnome-calendar" +SHOW_KEYBINDS = f"{TERMINAL} -t Keybinds -e python3 /home/grfreire/.config/qtile/list_keybinds.py" POWER_MENU = os.path.expanduser( "~/.scripts/bin/simple-power-menu" ) -WEB_QUICK_OPEN = os.path.expanduser( - "~/.scripts/bin/firefox-quick-keywords" -) -COLOR_PICKER = os.path.expanduser( - "~/.scripts/bin/clip-color" -) -EMOJI_LAUNCHER = os.path.expanduser( - "~/.scripts/bin/clip-moji" -) -SHOW_KEYBINDS = f"{TERMINAL} -t Keybinds -e python3 /home/grfreire/.config/qtile/list_keybinds.py" MEDIA_CONTROL = os.path.expanduser("~/.config/qtile/media_control.sh") keys = [ - # Launch programs - Key([MOD], "Return", lazy.spawn(TERMINAL), desc="Launch terminal"), - Key([MOD], "r", lazy.spawn(LAUNCHER), desc="Open application launcher"), - Key([MOD], "w", lazy.spawn(WEB), desc="Open web browser"), - Key([MOD], "p", lazy.spawn(WEB_QUICK_OPEN), desc="Open web browser quick launcher"), - Key([MOD], "f", lazy.spawn(FILE_MANAGER), desc="Open file manager"), - Key([MOD], "b", lazy.spawn(PASSWORD_MANAGER), desc="Open password manager"), # Closes window. Key([MOD], "q", lazy.window.kill(), desc="Kill focused window"), # Switch between windows @@ -53,24 +32,13 @@ keys = [ Key([MOD], "k", lazy.layout.up(), desc="Move focus up"), Key([ALT], "Tab", lazy.layout.next(), desc="Move window focus to other window"), # Move windows between left/right columns. - Key( - [MOD, "shift"], "h", lazy.layout.shuffle_left(), desc="Move window to the left" - ), - Key( - [MOD, "shift"], - "l", - lazy.layout.shuffle_right(), - desc="Move window to the right", - ), + Key([MOD, "shift"], "h", lazy.layout.shuffle_left(), desc="Move window to the left"), + Key([MOD, "shift"], "l", lazy.layout.shuffle_right(), desc="Move window to the right"), Key([MOD, "shift"], "j", lazy.layout.shuffle_down(), desc="Move window down"), Key([MOD, "shift"], "k", lazy.layout.shuffle_up(), desc="Move window up"), # Grow and shrink windows. - Key( - [MOD, "control"], "h", lazy.layout.shrink_main(), desc="Grow window to the left" - ), - Key( - [MOD, "control"], "l", lazy.layout.grow_main(), desc="Grow window to the right" - ), + Key([MOD, "control"], "h", lazy.layout.shrink_main(), desc="Grow window to the left"), + Key([MOD, "control"], "l", lazy.layout.grow_main(), desc="Grow window to the right"), Key([MOD, "control"], "j", lazy.layout.shrink_main(), desc="Grow window down"), Key([MOD, "control"], "k", lazy.layout.grow_main(), desc="Grow window up"), Key([MOD], "n", lazy.layout.normalize(), desc="Reset all window sizes"), @@ -87,11 +55,6 @@ keys = [ Key([MOD], "BackSpace", lazy.spawn(POWER_MENU), desc="Open power menu"), Key([], "Print", lazy.spawn(SCREENSHOT), desc="Take a screenshot of all the screens"), Key([MOD], "Print", lazy.spawn(SCREENSHOT_UTILITY), desc="Open screenshot utility"), - Key([MOD], "equal", lazy.spawn(ZOOM_UTILITY), desc="Open zoom utility"), - # Clipboard - Key([MOD, "shift"], "c", lazy.spawn(CLIPBOARD_MANAGER), desc="Launch clipboard manager"), - Key([MOD, ALT], "c", lazy.spawn(COLOR_PICKER), desc="Launch colorpicker"), - Key([MOD, "shift"], "e", lazy.spawn(EMOJI_LAUNCHER), desc="Launch emoji launcher"), # Media Key([], "XF86AudioPlay", lazy.spawn(f"{MEDIA_CONTROL} play"), desc="Media control - play"), Key([], "XF86AudioStop", lazy.spawn(f"{MEDIA_CONTROL} stop"), desc="Media control - stop"), diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc new file mode 100644 index 0000000..42f6a25 --- /dev/null +++ b/.config/sxhkd/sxhkdrc @@ -0,0 +1,32 @@ +# sxhkd config + +super + Return + $TERMINAL + +super + w + $BROWSER + +super + f + pcmanfm --no-desktop -n + +super + b + bitwarden-desktop + +super + equal + boomer + +super + r + rofi -icon-theme 'Paper' -show-icons -show drun + +super + p + ~/.scripts/bin/firefox-quick-keywords + +super + shift + c + rofi -modi "clipboard:greenclip print" -show clipboard -run-command '{cmd}' + +super + alt + c + ~/.scripts/bin/clip-color + +super + shift + e + ~/.scripts/bin/clip-moji +