From c0d11e4b79ab70aac12b56f41175d57bbbc4c88c Mon Sep 17 00:00:00 2001 From: TuDatTr Date: Fri, 22 May 2020 01:39:09 +0200 Subject: [PATCH] Added clipboard functionality to config/.script/screenshot.sh Fixed window screenshot in config/.config/i3/config Made terminal transparent again --- config/.Xdefaults | 9 +++++++++ config/.Xresources | 1 - config/.config/i3/config | 2 +- config/.local/share/ranger/bookmarks | 2 +- config/.scripts/screenshot.sh | 3 +++ vim/.vim/plugin/skeletons.vim | 2 +- vim/.vim/templates/skeleton.md | 4 +--- vim/.vim/templates/skeleton.sh | 1 + zsh/.zshrc | 3 ++- 9 files changed, 19 insertions(+), 8 deletions(-) create mode 100644 vim/.vim/templates/skeleton.sh diff --git a/config/.Xdefaults b/config/.Xdefaults index 86940be..3e8c914 100644 --- a/config/.Xdefaults +++ b/config/.Xdefaults @@ -15,3 +15,12 @@ URxvt.matcher.button: 1 ! Keyboard-select URxvt.keysym.M-Escape: perl:keyboard-select:activate URxvt.keyboard-select.clipboard: true + +! Term +urxvt*transparent: true +urxvt*shading: 20 +urxvt*blurRadius: 15 + +! Xft +Xft.dpi: 92 +Xft.antialias: 1 diff --git a/config/.Xresources b/config/.Xresources index d982a3b..8634f9f 100644 --- a/config/.Xresources +++ b/config/.Xresources @@ -34,4 +34,3 @@ ! white *.color7: #98abb2 *.color15: #c0bfbc - diff --git a/config/.config/i3/config b/config/.config/i3/config index 7459255..fd007c8 100644 --- a/config/.config/i3/config +++ b/config/.config/i3/config @@ -151,7 +151,7 @@ bindsym $mod+m exec thunderbird bindsym Control+Print exec --no-startup-id ~/.scripts/screenshot.sh screen # Window -bindsym Mod1+Print --release exec --no-startup-id ~/.scripts/screenshot.sh window +bindsym Mod1+Sys_Req --release exec --no-startup-id ~/.scripts/screenshot.sh window # Area bindsym Print --release exec --no-startup-id ~/.scripts/screenshot.sh area diff --git a/config/.local/share/ranger/bookmarks b/config/.local/share/ranger/bookmarks index a56a624..a0897ef 100644 --- a/config/.local/share/ranger/bookmarks +++ b/config/.local/share/ranger/bookmarks @@ -9,5 +9,5 @@ t:/home/tuan/Templates w:/home/tuan/workspace_l/Projects k:/home/tuan/Documents/CTF/TryHackMe/VulnUniversity q:/home/tuan/.nextcloud/Quick Drop -':/home/tuan/.byobu +':/home/tuan/Pictures/Screenshots e:/home/tuan/Documents/CTF/TryHackMe/Ice/2_Recon diff --git a/config/.scripts/screenshot.sh b/config/.scripts/screenshot.sh index a7a3789..45d6a7a 100755 --- a/config/.scripts/screenshot.sh +++ b/config/.scripts/screenshot.sh @@ -7,16 +7,19 @@ case $1 in filename=$(cat /proc/$(xdotool getwindowpid $(xdotool getwindowfocus))/comm)_$(date +%G-%m-%d_%H-%M-%S).png; maim -f png $d/$filename; dunstify -r 2 "Saved screenshot of screen in $d/$filename"; + xclip -selection clipboard -t image/png -i $d/$filename ;; "window"*) filename=$(cat /proc/$(xdotool getwindowpid $(xdotool getwindowfocus))/comm)_$(date +%G-%m-%d_%H-%M-%S).png maim -u -i $(xdotool getactivewindow) -f png $d/$filename; dunstify -r 2 "Saved screenshot of window in $d/$filename"; + xclip -selection clipboard -t image/png -i $d/$filename ;; "area"*) dunstify -r 2 'Taking screenshot from area.'; filename=$(cat /proc/$(xdotool getwindowpid $(xdotool getwindowfocus))/comm)_$(date +%G-%m-%d_%H-%M-%S).png; maim -u -s -f png $d/$filename; dunstify -r 2 "Saved in $d/$filename."; + xclip -selection clipboard -t image/png -i $d/$filename ;; esac diff --git a/vim/.vim/plugin/skeletons.vim b/vim/.vim/plugin/skeletons.vim index 75d36a1..1ad44a5 100644 --- a/vim/.vim/plugin/skeletons.vim +++ b/vim/.vim/plugin/skeletons.vim @@ -4,5 +4,5 @@ augroup templates autocmd BufNewFile *.* silent! execute '0r $HOME/.vim/templates/skeleton.'.expand(":e") " parse special text in the templates after the read - autocmd BufNewFile * %substitute#\[:VIM_EVAL:\]\(.\{-\}\)\[:END_EVAL:\]#\=eval(submatch(1))#ge + autocmd BufNewFile * %s#\[:VIM_EVAL:\]\(.\{-\}\)\[:END_EVAL:\]#\=eval(submatch(1))#ge augroup END diff --git a/vim/.vim/templates/skeleton.md b/vim/.vim/templates/skeleton.md index 3581a0d..c099286 100644 --- a/vim/.vim/templates/skeleton.md +++ b/vim/.vim/templates/skeleton.md @@ -1,7 +1,5 @@ --- - title: + title: [:VIM_EVAL:]expand('%:p:h:t')[:END_EVAL:] author: Tuan-Dat Tran date: [:VIM_EVAL:]strftime('%Y-%m-%d')[:END_EVAL:] ... - -# [:VIM_EVAL:]system ("basename $(pwd)")[:END_EVAL:] diff --git a/vim/.vim/templates/skeleton.sh b/vim/.vim/templates/skeleton.sh new file mode 100644 index 0000000..1a24852 --- /dev/null +++ b/vim/.vim/templates/skeleton.sh @@ -0,0 +1 @@ +#!/bin/sh diff --git a/zsh/.zshrc b/zsh/.zshrc index 0d4b7b2..cef5583 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -2,7 +2,8 @@ export ZSH="$HOME/.oh-my-zsh" export PATH="$PATH:$HOME/.go/bin:$HOME/.local/bin:$HOME/.cargo/bin:$HOME/.dotnet/tools" export DOTNET_CLI_TELEMETRY_OPTOUT=1 -export SecList=$HOME/Local/PenTesting/SecLists/ +export PenTestTools=$HOME/Local/PenTesting/ +export CTF=$HOME/Documents/CTF/ # Alias