1
0
mirror of https://github.com/tiyn/dotfiles.git synced 2025-04-19 16:27:45 +02:00

Compare commits

..

2 Commits

Author SHA1 Message Date
20d7179ce1 zsh: added shortcut for autosuggest 2023-10-24 06:56:54 +02:00
8a3965e608 tools: improved screenshotmenu with colorpicker 2023-10-24 06:36:43 +02:00
4 changed files with 20 additions and 17 deletions

View File

@ -39,7 +39,7 @@ super + Return
$TERMINAL $TERMINAL
Print Print
maimpick screenshotmenu
super + shift + space super + shift + space
dunstctl close-all dunstctl close-all

View File

@ -53,6 +53,7 @@ RPROMPT='%B%{$fg[blue]%}$vcs_info_msg_0_%{$reset_color%}%b'
source /usr/share/zsh/plugins/zsh-autocomplete/zsh-autocomplete.plugin.zsh source /usr/share/zsh/plugins/zsh-autocomplete/zsh-autocomplete.plugin.zsh
bindkey '\t' menu-select "$terminfo[kcbt]" menu-select bindkey '\t' menu-select "$terminfo[kcbt]" menu-select
bindkey -M menuselect '\t' menu-complete "$terminfo[kcbt]" reverse-menu-complete bindkey -M menuselect '\t' menu-complete "$terminfo[kcbt]" reverse-menu-complete
bindkey -M menuselect '[C' autosuggest-accept
zstyle ':autocomplete:*' list-lines 7 zstyle ':autocomplete:*' list-lines 7
zstyle ':autocomplete:*' widget-style menu-select zstyle ':autocomplete:*' widget-style menu-select
zle -A {.,}history-incremental-search-forward zle -A {.,}history-incremental-search-forward

View File

@ -1,16 +0,0 @@
#!/bin/sh
# Requires maim. It lets you choose the kind of screenshot to take,
# including copying the image or even highlighting an area to copy.
output="$HOME/downloads/screenshot-$(date '+%Y-%m-%d_%H-%M-%S').png"
xclip_cmd="xclip -sel clip -t image/png"
case "$(printf "a selected area\\ncurrent window\\nfull screen\\na selected area (clipboard)\\ncurrent window (clipboard)\\nfull screen (clipboard)\\ncolor picker (clipboard)" | dmenu -l 6 -i -p "Screenshot which area?")" in
"a selected area") maim -s $output ;;
"current window") maim -i "$(xdotool getactivewindow)" $output ;;
"full screen") maim $output ;;
"a selected area (clipboard)") maim -s | ${xclip_cmd} ;;
"current window (clipboard)") maim -i "$(xdotool getactivewindow)" | ${xclip_cmd} ;;
"full screen (clipboard)") maim | ${xclip_cmd} ;;
esac

18
.local/bin/tools/screenshotmenu Executable file
View File

@ -0,0 +1,18 @@
#!/bin/sh
# Requires maim. It lets you choose the kind of screenshot to take,
# including copying the image or even highlighting an area to copy.
output="$HOME/downloads/screenshot-$(date '+%Y-%m-%d_%H-%M-%S').png"
xclip_img="xclip -sel clip -t image/png"
xclip_txt="xclip -sel clip -t text/plain"
case "$(printf "a selected area\\ncurrent window\\nfull screen\\na selected area (copy)\\ncurrent window (copy)\\nfull screen (copy)\\ncolor picker (copy)" | dmenu -l 6 -i -p "Screenshot which area?")" in
"a selected area") maim -s $output ;;
"current window") maim -i "$(xdotool getactivewindow)" $output ;;
"full screen") maim $output ;;
"a selected area (copy)") maim -s | ${xclip_img} ;;
"current window (copy)") maim -i "$(xdotool getactivewindow)" | ${xclip_img} ;;
"full screen (copy)") maim | ${xclip_img} ;;
"color picker (copy)") xcolor |tr -d '\n' | ${xclip_txt} ;;
esac