Compare commits

..

No commits in common. "54e7c0528246227b4ff67a150bb2b5644386e646" and "253599cfcb190252e2132845763b076fe9124709" have entirely different histories.

6 changed files with 38 additions and 72 deletions

View file

@ -1,84 +1,52 @@
#!/bin/bash
#!/bin/sh
declare -A temp_files
temp_files[command_to_source]=$(mktemp)
clean() {
rm -- "${temp_files[@]}"
}
usage() {
cat << EOF
error_usage() {
>&2 cat << EOF
Usage :
glurp full|area clip|file
EOF
}
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
exit 1
}
screenshot_path() {
local path
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)"
printf %s "/tmp/screenshot-${USER}-$(date +%N).png"
}
trap error_usage_clean EXIT
set -e
slurp=()
grim_args=()
wl_copy=()
grim=grim
wl_copy_args="-t image/png"
# Arguments
case "$1" in
full)
:
;;
area)
slurp+=(slurp \|)
grim_args+=(-g -)
slurp=slurp
pipe1='|'
grim_args="-g -"
;;
*)
false
error_usage
;;
esac
shift
case "$1" in
clip)
wl_copy+=(\| wl-copy -t image/png)
grim_args+=(-)
pipe2='|'
wl_copy=wl-copy
;;
file)
grim_args+=("$(screenshot_path "/tmp/${USER}")")
grim_args="${grim_args} $(screenshot_path)"
;;
*)
false
error_usage
;;
esac
shift
cat > "${temp_files[command_to_source]}" << EOF
${slurp[@]} grim ${grim_args[@]} ${@} ${wl_copy[@]}
EOF
[ -n "$wl_copy" ] && wl_copy="${wl_copy} ${wl_copy_args}"
trap clean EXIT
sh -s < "${temp_files[command_to_source]}"
# Execution
set -xe
"$slurp" "$pipe1" "$grim" "$grim_args" "$pipe2" "$wl_copy"

3
bin/sshot-file Executable file
View file

@ -0,0 +1,3 @@
#!/bin/sh
exec printf "$@" "screenshot-%s.${1:-png}" "$(date +"%Y_%m_%d-%N")"

View file

@ -55,7 +55,7 @@ decoration {
}
# Animations
$animSpeed = 3
$animSpeed = 4
animations {
enabled = yes

View file

@ -23,7 +23,7 @@ DLAGENTS=('file::/usr/bin/curl -qgC - -o %o %u'
#-- The package required by makepkg to download VCS sources
# Format: 'protocol::package'
VCSCLIENTS=('bzr::breezy'
VCSCLIENTS=('bzr::bzr'
'fossil::fossil'
'git::git'
'hg::mercurial'
@ -38,7 +38,7 @@ CHOST="x86_64-pc-linux-gnu"
#-- Compiler and Linker Flags
#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 \
-fstack-clash-protection -fcf-protection"
CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"
@ -134,15 +134,15 @@ DBGSRCDIR="/usr/src/debug"
# COMPRESSION DEFAULTS
#########################################################################
#
COMPRESSGZ=(gzip -c -f -n)
COMPRESSBZ2=(bzip2 -c -f)
COMPRESSGZ=(pigz -c -f -n)
COMPRESSBZ2=(pbzip2 -c -f)
COMPRESSXZ=(xz -c -z --threads=0 -)
COMPRESSZST=(zstd -c -z -q --threads=0 -)
COMPRESSLRZ=(lrzip -q)
COMPRESSLZO=(lzop -q)
COMPRESSZ=(compress -c -f)
COMPRESSLZ4=(lz4 -q)
COMPRESSLZ=(lzip -c -f)
COMPRESSLZ=(plzip -c -f)
#########################################################################
# EXTENSION DEFAULTS

View file

@ -7,14 +7,3 @@
defaultbranch = main
[pull]
rebase = true
[alias]
s = status
l = log
c = commit
d = diff
p = pull
ch = checkout
a = add
sh = show
m = merge
r = rebase

View file

@ -9,5 +9,11 @@ else
fi
# 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'