The bare $HOME repo is gone. This is now the rice: install.sh, rice-* scripts in bin/, configs in home/ linked into $HOME, theme templates, st and the particle wallpaper. Clone to ~/rice and run install.sh.
18 lines
624 B
Bash
Executable file
18 lines
624 B
Bash
Executable file
#!/usr/bin/env bash
|
|
# rice-clip copy|paste - one copy/paste shortcut for terminals and GUI apps.
|
|
# Terminals want Ctrl+Shift+C/V; everything else wants Ctrl+C/V.
|
|
set -uo pipefail
|
|
|
|
class=$(xdotool getactivewindow getwindowclassname 2>/dev/null)
|
|
case "${class,,}" in
|
|
st|st-256color|kitty|alacritty|xterm|urxvt|org.wezfurlong.wezterm|com.mitchellh.ghostty|rice-float|rice-scratchpad|rice-about)
|
|
mods=ctrl+shift ;;
|
|
*)
|
|
mods=ctrl ;;
|
|
esac
|
|
|
|
case "${1:-}" in
|
|
copy) xdotool key --clearmodifiers "$mods+c" ;;
|
|
paste) xdotool key --clearmodifiers "$mods+v" ;;
|
|
*) echo "usage: rice-clip copy|paste" >&2; exit 2 ;;
|
|
esac
|