Compare commits
No commits in common. "54e7c0528246227b4ff67a150bb2b5644386e646" and "253599cfcb190252e2132845763b076fe9124709" have entirely different histories.
54e7c05282
...
253599cfcb
6 changed files with 38 additions and 72 deletions
72
bin/glurp
72
bin/glurp
|
@ -1,84 +1,52 @@
|
||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
declare -A temp_files
|
error_usage() {
|
||||||
temp_files[command_to_source]=$(mktemp)
|
>&2 cat << EOF
|
||||||
|
|
||||||
clean() {
|
|
||||||
rm -- "${temp_files[@]}"
|
|
||||||
}
|
|
||||||
|
|
||||||
usage() {
|
|
||||||
cat << EOF
|
|
||||||
Usage :
|
Usage :
|
||||||
glurp full|area clip|file
|
glurp full|area clip|file
|
||||||
EOF
|
EOF
|
||||||
}
|
exit 1
|
||||||
|
|
||||||
error() {
|
|
||||||
>&2 printf '\033[0m\033[1;31mERROR:\033[0m \033[1m%s\033[0m\n' "$*"
|
|
||||||
}
|
|
||||||
|
|
||||||
error_usage() {
|
|
||||||
error "Invalid usage"
|
|
||||||
>&2 usage
|
|
||||||
}
|
|
||||||
|
|
||||||
error_usage_clean() {
|
|
||||||
error_usage
|
|
||||||
clean
|
|
||||||
}
|
}
|
||||||
|
|
||||||
screenshot_path() {
|
screenshot_path() {
|
||||||
local path
|
printf %s "/tmp/screenshot-${USER}-$(date +%N).png"
|
||||||
if [ -n "$1" ]; then
|
|
||||||
path="$1"
|
|
||||||
else
|
|
||||||
path=.
|
|
||||||
fi
|
|
||||||
mkdir -p "$path"
|
|
||||||
printf '%sscreenshot-%s.png' "${path}/" "$(date +%Y_%m_%d_%H_%M_%S_%N)"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
trap error_usage_clean EXIT
|
grim=grim
|
||||||
set -e
|
wl_copy_args="-t image/png"
|
||||||
|
|
||||||
slurp=()
|
|
||||||
grim_args=()
|
|
||||||
wl_copy=()
|
|
||||||
|
|
||||||
|
# Arguments
|
||||||
case "$1" in
|
case "$1" in
|
||||||
full)
|
full)
|
||||||
:
|
|
||||||
;;
|
;;
|
||||||
area)
|
area)
|
||||||
slurp+=(slurp \|)
|
slurp=slurp
|
||||||
grim_args+=(-g -)
|
pipe1='|'
|
||||||
|
grim_args="-g -"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
false
|
error_usage
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
shift
|
shift
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
clip)
|
clip)
|
||||||
wl_copy+=(\| wl-copy -t image/png)
|
pipe2='|'
|
||||||
grim_args+=(-)
|
wl_copy=wl-copy
|
||||||
;;
|
;;
|
||||||
file)
|
file)
|
||||||
grim_args+=("$(screenshot_path "/tmp/${USER}")")
|
grim_args="${grim_args} $(screenshot_path)"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
false
|
error_usage
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
shift
|
shift
|
||||||
|
|
||||||
cat > "${temp_files[command_to_source]}" << EOF
|
[ -n "$wl_copy" ] && wl_copy="${wl_copy} ${wl_copy_args}"
|
||||||
${slurp[@]} grim ${grim_args[@]} ${@} ${wl_copy[@]}
|
|
||||||
EOF
|
|
||||||
|
|
||||||
trap clean EXIT
|
# Execution
|
||||||
|
set -xe
|
||||||
sh -s < "${temp_files[command_to_source]}"
|
"$slurp" "$pipe1" "$grim" "$grim_args" "$pipe2" "$wl_copy"
|
||||||
|
|
||||||
|
|
3
bin/sshot-file
Executable file
3
bin/sshot-file
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/sh
|
||||||
|
exec printf "$@" "screenshot-%s.${1:-png}" "$(date +"%Y_%m_%d-%N")"
|
||||||
|
|
|
@ -55,7 +55,7 @@ decoration {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Animations
|
# Animations
|
||||||
$animSpeed = 3
|
$animSpeed = 4
|
||||||
animations {
|
animations {
|
||||||
enabled = yes
|
enabled = yes
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ DLAGENTS=('file::/usr/bin/curl -qgC - -o %o %u'
|
||||||
|
|
||||||
#-- The package required by makepkg to download VCS sources
|
#-- The package required by makepkg to download VCS sources
|
||||||
# Format: 'protocol::package'
|
# Format: 'protocol::package'
|
||||||
VCSCLIENTS=('bzr::breezy'
|
VCSCLIENTS=('bzr::bzr'
|
||||||
'fossil::fossil'
|
'fossil::fossil'
|
||||||
'git::git'
|
'git::git'
|
||||||
'hg::mercurial'
|
'hg::mercurial'
|
||||||
|
@ -38,7 +38,7 @@ CHOST="x86_64-pc-linux-gnu"
|
||||||
|
|
||||||
#-- Compiler and Linker Flags
|
#-- Compiler and Linker Flags
|
||||||
#CPPFLAGS=""
|
#CPPFLAGS=""
|
||||||
CFLAGS="-march=native -O2 -pipe -fno-plt -fexceptions \
|
CFLAGS="-march=native -mtune=generic -O2 -pipe -fno-plt -fexceptions \
|
||||||
-Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \
|
-Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \
|
||||||
-fstack-clash-protection -fcf-protection"
|
-fstack-clash-protection -fcf-protection"
|
||||||
CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"
|
CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"
|
||||||
|
@ -134,15 +134,15 @@ DBGSRCDIR="/usr/src/debug"
|
||||||
# COMPRESSION DEFAULTS
|
# COMPRESSION DEFAULTS
|
||||||
#########################################################################
|
#########################################################################
|
||||||
#
|
#
|
||||||
COMPRESSGZ=(gzip -c -f -n)
|
COMPRESSGZ=(pigz -c -f -n)
|
||||||
COMPRESSBZ2=(bzip2 -c -f)
|
COMPRESSBZ2=(pbzip2 -c -f)
|
||||||
COMPRESSXZ=(xz -c -z --threads=0 -)
|
COMPRESSXZ=(xz -c -z --threads=0 -)
|
||||||
COMPRESSZST=(zstd -c -z -q --threads=0 -)
|
COMPRESSZST=(zstd -c -z -q --threads=0 -)
|
||||||
COMPRESSLRZ=(lrzip -q)
|
COMPRESSLRZ=(lrzip -q)
|
||||||
COMPRESSLZO=(lzop -q)
|
COMPRESSLZO=(lzop -q)
|
||||||
COMPRESSZ=(compress -c -f)
|
COMPRESSZ=(compress -c -f)
|
||||||
COMPRESSLZ4=(lz4 -q)
|
COMPRESSLZ4=(lz4 -q)
|
||||||
COMPRESSLZ=(lzip -c -f)
|
COMPRESSLZ=(plzip -c -f)
|
||||||
|
|
||||||
#########################################################################
|
#########################################################################
|
||||||
# EXTENSION DEFAULTS
|
# EXTENSION DEFAULTS
|
||||||
|
|
|
@ -7,14 +7,3 @@
|
||||||
defaultbranch = main
|
defaultbranch = main
|
||||||
[pull]
|
[pull]
|
||||||
rebase = true
|
rebase = true
|
||||||
[alias]
|
|
||||||
s = status
|
|
||||||
l = log
|
|
||||||
c = commit
|
|
||||||
d = diff
|
|
||||||
p = pull
|
|
||||||
ch = checkout
|
|
||||||
a = add
|
|
||||||
sh = show
|
|
||||||
m = merge
|
|
||||||
r = rebase
|
|
||||||
|
|
|
@ -9,5 +9,11 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# git
|
# git
|
||||||
alias g=git
|
alias ga='git add'
|
||||||
|
alias gs='git status'
|
||||||
|
alias gc='git commit'
|
||||||
|
alias gm='git merge'
|
||||||
|
alias gch='git checkout'
|
||||||
|
alias gp='git pull'
|
||||||
|
alias gpus='git push'
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue