diff --git a/.bash_aliases b/.bash_aliases index 7dca326..68b8cc3 100644 --- a/.bash_aliases +++ b/.bash_aliases @@ -3,7 +3,7 @@ alias python3='python3.9' alias pip3='python3.9 -m pip' # Alias to restart plasmashell for Kubuntu Plasma session -alias kapp-plasmashell='sudo pkill plasmashell && plasmashell --replace &> /dev/null &' +alias kapp-plasmashell='sudo pkill plasmashell && sleep 1 && (plasmashell --replace &> /dev/null &)' # Alias to clear swap alias kapp-swap='sudo swapoff -a && sudo swapon -a' # Alias to initialize github user diff --git a/.gitmodules b/.gitmodules index abe4495..49fb227 100644 --- a/.gitmodules +++ b/.gitmodules @@ -31,3 +31,9 @@ [submodule ".tmux/plugins/tpm"] path = .tmux/plugins/tpm url = https://github.com/tmux-plugins/tpm +[submodule ".tmux/plugins/tmux-yank"] + path = .tmux/plugins/tmux-yank + url = https://github.com/tmux-plugins/tmux-yank +[submodule ".tmux/plugins/tmux-better-mouse-mode"] + path = .tmux/plugins/tmux-better-mouse-mode + url = https://github.com/NHDaly/tmux-better-mouse-mode diff --git a/.tmux.conf b/.tmux.conf index e55823b..3405b01 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -20,7 +20,28 @@ #+ Vim plugin 'Colorizer' does not reflect the actual 256colour values #+ See https://jonasjacek.github.io/colors/ for a full list of 256colours +# Settings for terminal text selection / copy options +# + Source: https://www.seanh.cc/2020/12/27/copy-and-paste-in-tmux/ +# + Depends: https://github.com/tmux-plugins/tmux-yank#linux set -g mouse on +# These bindings are for X Windows only. If you're using a different +# window system you have to replace the `xsel` commands with something +# else. See https://github.com/tmux/tmux/wiki/Clipboard#available-tools +bind -T copy-mode DoubleClick1Pane select-pane \; send -X select-word \; send -X copy-pipe-no-clear "xsel -i" +bind -T copy-mode-vi DoubleClick1Pane select-pane \; send -X select-word \; send -X copy-pipe-no-clear "xsel -i" +bind -n DoubleClick1Pane select-pane \; copy-mode -M \; send -X select-word \; send -X copy-pipe-no-clear "xsel -i" +bind -T copy-mode TripleClick1Pane select-pane \; send -X select-line \; send -X copy-pipe-no-clear "xsel -i" +bind -T copy-mode-vi TripleClick1Pane select-pane \; send -X select-line \; send -X copy-pipe-no-clear "xsel -i" +bind -n TripleClick1Pane select-pane \; copy-mode -M \; send -X select-line \; send -X copy-pipe-no-clear "xsel -i" +bind -n MouseDown2Pane run "tmux set-buffer -b primary_selection \"$(xsel -o)\"; tmux paste-buffer -b primary_selection; tmux delete-buffer -b primary_selection" +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'tmux-plugins/tmux-yank' +set -g @yank_action 'copy-pipe-no-clear' +bind -T copy-mode C-c send -X copy-pipe-no-clear "xsel -i --clipboard" +bind -T copy-mode-vi C-c send -X copy-pipe-no-clear "xsel -i --clipboard" + +set-option -s set-clipboard external +bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -selection clipboard -i" # remap shortcut prefix from 'C-b' to 'C-z' unbind C-b diff --git a/.tmux/plugins/tmux-better-mouse-mode b/.tmux/plugins/tmux-better-mouse-mode new file mode 160000 index 0000000..aa59077 --- /dev/null +++ b/.tmux/plugins/tmux-better-mouse-mode @@ -0,0 +1 @@ +Subproject commit aa59077c635ab21b251bd8cb4dc24c415e64a58e diff --git a/.tmux/plugins/tmux-yank b/.tmux/plugins/tmux-yank new file mode 160000 index 0000000..1b1a436 --- /dev/null +++ b/.tmux/plugins/tmux-yank @@ -0,0 +1 @@ +Subproject commit 1b1a436e19f095ae8f825243dbe29800a8acd25c diff --git a/.xbindkeysrc b/.xbindkeysrc index 39fc69b..666456d 100644 --- a/.xbindkeysrc +++ b/.xbindkeysrc @@ -42,6 +42,11 @@ "xbindkeys_show" control+shift + q +# Disables middle-mouse button +# + If this doesn't work, try to remove '+ Release' +#"echo -n | xsel -n -i; pkill xbindkeys; xdotool click 2; xbindkeys" +# b:2 + Release + # set directly keycode (here control + f with my keyboard) #"xterm" # c:41 + m:0x4