diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2026-06-26 09:52:47 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2026-06-26 09:52:47 +0900 |
| commit | 69da68576ed38fc325c8f29c7c25aa978e314665 (patch) | |
| tree | d7618178bc32981bd3ae8db85083b06c7a4192e8 /ar | |
| parent | acff8d35ad55ccae03fe9c73ab6c53aeb316324e (diff) | |
modified bin/maimpick, created alacritty/
Diffstat (limited to 'ar')
| -rw-r--r-- | ar/.config/alacritty/alacritty.toml | 77 | ||||
| -rw-r--r-- | ar/.config/alacritty/themes/gruvbox_dark.toml | 27 | ||||
| -rwxr-xr-x | ar/.local/bin/maimpick | 34 |
3 files changed, 137 insertions, 1 deletions
diff --git a/ar/.config/alacritty/alacritty.toml b/ar/.config/alacritty/alacritty.toml new file mode 100644 index 0000000..e3cba14 --- /dev/null +++ b/ar/.config/alacritty/alacritty.toml @@ -0,0 +1,77 @@ +[general] +import = ["~/.config/alacritty/themes/gruvbox_dark.toml"] + +[env] +TERM = "xterm-256color" + +[terminal.shell] +program = "/usr/bin/zsh" +args = ["-l"] + +[window] +padding = { x = 1, y = 1 } +dynamic_padding = true +opacity = 0.65 +decorations = "None" +dynamic_title = true + +[window.dimensions] +columns = 80 +lines = 24 + +[font] +size = 12.0 + +[font.normal] +family = "monospace" +style = "Regular" + +[font.bold] +family = "monospace" +style = "Bold" + +[font.italic] +family = "monospace" +style = "Italic" + +[cursor] +style = { shape = "Block", blinking = "On" } +blink_interval = 800 +unfocused_hollow = true + +[scrolling] +history = 10000 +multiplier = 3 + +[selection] +semantic_escape_chars = " `'\"()[]{}" +save_to_clipboard = false + +[keyboard] +bindings = [ + { key = "c", mods = "Alt", action = "Copy" }, + { key = "v", mods = "Alt", action = "Paste" }, + { key = "C", mods = "Control|Shift", action = "Copy" }, + { key = "V", mods = "Control|Shift", action = "Paste" }, + { key = "Insert", mods = "Shift", action = "PasteSelection" }, + { key = "K", mods = "Alt|Shift", action = "IncreaseFontSize" }, + { key = "J", mods = "Alt|Shift", action = "DecreaseFontSize" }, + { key = "Plus", mods = "Alt|Shift", action = "ResetFontSize" }, + { key = "f", mods = "Alt", action = "ToggleFullscreen" }, + { key = "F11", action = "ToggleFullscreen" }, + { key = "Return", mods = "Alt|Shift", action = "SpawnNewInstance" }, + { key = "PageUp", mods = "Shift", action = "ScrollPageUp" }, + { key = "PageDown", mods = "Shift", action = "ScrollPageDown" }, + { key = "Space", mods = "Shift", action = "ToggleViMode" }, + { key = "F", mods = "Control|Shift", action = "SearchForward" }, + { key = "B", mods = "Control|Shift", action = "SearchBackward" }, +] + +[hints] +[[hints.enabled]] +regex = '(https://|http://|file://|git://|ssh://|ftp://|mailto:)[^\s<>"]+' +hyperlinks = true +command = "xdg-open" +post_processing = true +mouse = { enabled = true, mods = "Control" } +binding = { key = "U", mods = "Control|Shift" } diff --git a/ar/.config/alacritty/themes/gruvbox_dark.toml b/ar/.config/alacritty/themes/gruvbox_dark.toml new file mode 100644 index 0000000..706b416 --- /dev/null +++ b/ar/.config/alacritty/themes/gruvbox_dark.toml @@ -0,0 +1,27 @@ +[colors.primary] +background = "#282828" +foreground = "#ebdbb2" + +[colors.cursor] +cursor = "#add8e6" +text = "#282828" + +[colors.normal] +black = "#282828" +red = "#cc241d" +green = "#939e45" +yellow = "#d79921" +blue = "#458588" +magenta = "#b16286" +cyan = "#689d6a" +white = "#a89984" + +[colors.bright] +black = "#928374" +red = "#fb4934" +green = "#b8bb26" +yellow = "#fabd2f" +blue = "#83a598" +magenta = "#d3869b" +cyan = "#8ec07c" +white = "#ebdbb2" diff --git a/ar/.local/bin/maimpick b/ar/.local/bin/maimpick index 06d9092..ea227ae 100755 --- a/ar/.local/bin/maimpick +++ b/ar/.local/bin/maimpick @@ -12,12 +12,44 @@ ocr_cmd="xclip -sel clip" [ -d "$output_dir" ] || mkdir -p "$output_dir" -case "$(printf "a selected area\\ncurrent window\\nfull screen\\na selected area (copy)\\ncurrent window (copy)\\nfull screen (copy)\\ncopy selected image to text" | dmenu -l 7 -i -p "Screenshot which area?")" in +# Number of connected monitors (first line of xrandr --listmonitors). +mon_count="$(xrandr --listmonitors | awk 'NR==1{print $2}')" + +# Prompt for a monitor and print its maim -g geometry (WxH+X+Y), or nothing if +# the picker is cancelled. +pick_monitor() { + monitors="$(xrandr --listmonitors | tail -n +2)" + name="$(printf '%s\n' "$monitors" | awk '{print $NF}' | dmenu -i -p "Which monitor?")" || return 1 + [ -z "$name" ] && return 1 + printf '%s\n' "$monitors" | awk -v n="$name" '$NF==n {gsub(/\/[0-9]+/,"",$3); print $3}' +} + +# Build the menu, only offering the monitor entries when more than one is +# connected. +options="a selected area +current window +full screen" +[ "$mon_count" -gt 1 ] 2>/dev/null && options="$options +selected monitor" +options="$options +a selected area (copy) +current window (copy) +full screen (copy)" +[ "$mon_count" -gt 1 ] 2>/dev/null && options="$options +selected monitor (copy)" +options="$options +copy selected image to text" + +lines="$(printf '%s\n' "$options" | wc -l)" + +case "$(printf '%s\n' "$options" | dmenu -l "$lines" -i -p "Screenshot which area?")" in "a selected area") maim -u -s "$output_dir"pic-selected-"${output}" ;; "current window") maim -B -q -d 0.2 -i "$(xdotool getactivewindow)" "$output_dir"pic-window-"${output}" ;; "full screen") maim -q -d 0.2 "$output_dir"pic-full-"${output}" ;; +"selected monitor") geo="$(pick_monitor)" && [ -n "$geo" ] && maim -q -d 0.2 -g "$geo" "$output_dir"pic-monitor-"${output}" ;; "a selected area (copy)") maim -u -s | ${xclip_cmd} ;; "current window (copy)") maim -q -d 0.2 -i "$(xdotool getactivewindow)" | ${xclip_cmd} ;; "full screen (copy)") maim -q -d 0.2 | ${xclip_cmd} ;; +"selected monitor (copy)") geo="$(pick_monitor)" && [ -n "$geo" ] && maim -q -d 0.2 -g "$geo" | ${xclip_cmd} ;; "copy selected image to text") tmpfile=$(mktemp /tmp/ocr-XXXXXX.png) && maim -u -s >"$tmpfile" && tesseract "$tmpfile" - -l eng | ${ocr_cmd} && rm "$tmpfile" ;; esac |
