1
0
mirror of https://github.com/frebib/dotfiles.git synced 2024-06-14 12:57:23 +00:00

Compare commits

...

3 Commits

Author SHA1 Message Date
b52496bbb3
scripts/screenshot: add --active and --clip args
--active uses the active window as selection boundary, instead of the root window, or prompting for a window selection
--clip adds the image to the clipboard and exits without uploading

Signed-off-by: Joe Groocock <me@frebib.net>
2020-05-30 00:28:27 +01:00
308eff050e
aliases: signoff with git-commit aliases
Remove gcmst as it is almost never used

Signed-off-by: Joe Groocock <me@frebib.net>
2020-05-30 00:22:27 +01:00
bae4f0b819
solaar: hide window on startup
The new default behaviour is to show, not hide

Signed-off-by: Joe Groocock <me@frebib.net>
2020-05-30 00:21:00 +01:00
3 changed files with 18 additions and 11 deletions

View File

@ -5,7 +5,7 @@ After=graphical-session.target
[Service] [Service]
Type=simple Type=simple
ExecStart=/usr/bin/solaar --restart-on-wake-up -d ExecStart=/usr/bin/solaar --debug --restart-on-wake-up --window=hide
KillMode=process KillMode=process
Restart=on-failure Restart=on-failure

13
aliases
View File

@ -130,13 +130,12 @@ alias gau="git add -u"
alias gaN="git add -N" alias gaN="git add -N"
alias gaa="ga -A" alias gaa="ga -A"
alias grm="git rm" alias grm="git rm"
alias gc="git commit" alias gc="git commit -s"
alias gcm="gc -m" alias gcm="git commit -s -m"
gcmst() { git stash -u -k && git commit -m "$1" && git stash pop; } alias gca="git commit -s --amend --date=\"$(date -R)\""
alias gca="git commit --amend --date=\"$(date -R)\"" alias gcn="git commit -s --no-edit"
alias gcn="git commit --no-edit" alias gcan="gca -s --no-edit"
alias gcan="gca --no-edit" alias gcam="gca -s -m"
alias gcam="gca -m"
alias gst="git status" alias gst="git status"
alias gm="git merge" alias gm="git merge"

View File

@ -43,6 +43,9 @@ args=(-g "$geom")
if xwininfo -id "$winid" | grep -qw root; then if xwininfo -id "$winid" | grep -qw root; then
isroot=1 isroot=1
args+=(-i "$winid") args+=(-i "$winid")
elif [ "$1" == "--active" -o "$1" == "-a" ]; then
args+=(-i "$(xdotool getactivewindow)")
shift
fi fi
# Take the screenshot and save it # Take the screenshot and save it
@ -57,10 +60,15 @@ if [ "$isroot" != "1" ]; then
convert "$out_path" \( +clone -background black -alpha set -channel Alpha -evaluate set 60% -shadow 100x16+0+0 \) +swap -background none -layers merge +repage "$out_path" || : convert "$out_path" \( +clone -background black -alpha set -channel Alpha -evaluate set 60% -shadow 100x16+0+0 \) +swap -background none -layers merge +repage "$out_path" || :
fi fi
notif_id=$(send_notification "Screenshot uploading" "$FILENAME<br><br>The image is available in the clipboard immediately" || true) if [ "$1" == "--clip" -o "$1" == "-c" ]; then
# Add image to clipboard
xclip -i "$out_path" -selection clipboard -t image/png
send_notification "Screenshot captured" "$FILENAME<br><br>The image is available in the clipboard"
# Add image to clipboard exit 0
xclip -i "$out_path" -selection clipboard -t image/png fi
notif_id=$(send_notification "Screenshot uploading" "$FILENAME" || true)
# 'Upload' the screenshot # 'Upload' the screenshot
if ! error=$(scp -C $out_path $SCP_HOST:$SCP_PATH 2>&1); then if ! error=$(scp -C $out_path $SCP_HOST:$SCP_PATH 2>&1); then