Add support for region/window screenshot to file (maim)

master
Quentin Duchemin 2019-02-05 18:17:30 +01:00
parent ba482e3efc
commit 359ba4722d
Signed by: Chosto
GPG Key ID: 0547178FEEDE7D6B
6 changed files with 32 additions and 2 deletions

View File

@ -202,3 +202,8 @@ exec --no-startup-id cadence-session-start --start
exec --no-startup-id jack-matchmaker -p ~/.config/jack-matchmaker/patterns
exec thunderbird
# Screenshot
# Selection, highlight, jpeg 9/10 quality, 5px selection border, hide cursor
# Save to file
bindsym Print exec ~/.config/i3/scripts/screenshot.sh

View File

@ -213,3 +213,8 @@ exec xrandr --dpi 160
# Mail client
exec thunderbird
# Screenshot
# Selection, highlight, jpeg 9/10 quality, 5px selection border, hide cursor
# Save to file
bindsym Print exec ~/.config/i3/scripts/screenshot.sh

View File

@ -0,0 +1,10 @@
#!/bin/bash
path="$SCREENSHOT_PATH"
output=`date +${path}/%Y-%m-%d_%H:%M:%S.jpg`
if [ ! -d "${path}" ]; then
mkdir "${path}"
fi
touch "${output}"
maim -sl --color=0.6,0.4,0.2,0.2 -f jpg -u -m 9 -b 5 > "${output}"

View File

@ -1,6 +1,6 @@
{
"color_scheme": "Packages/Monokai - Spacegray/Monokai - Spacegray.tmTheme",
"font_size": 10,
"font_size": 11,
"ignored_packages":
[
"Markdown",

8
.zshrc
View File

@ -102,9 +102,17 @@ alias cp="cpv"
# To use when .cfg contains a bare git repo.
# See this https://developer.atlassian.com/blog/2016/02/best-way-to-store-dotfiles-git-bare-repo/
alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'
# Mount VPS as FUSE
alias ovh='sshfs chosto@51.75.250.228:/home/chosto /mnt/ovh'
# SSH port forwarding for Picasoft LDAP
alias ldap_pica='sudo ssh -L 389:localhost:389 qduchemi@monitoring.picasoft.net -i /home/.ssh/id_rsa'
# Start ssh-agent and retain passphrase for 1 hour
# ssh-add is not used for convenience
# Instead "AddKeysToAgent yes" option in ~/.ssh/config for "Host *"
eval "$(ssh-agent -s -t 3600)"
# Default path for screenshots
export SCREENSHOT_PATH=~/img/screenshot

View File

@ -36,6 +36,7 @@ Configuration makes use of these things, just to record but not mandatory :
* Fonts : Noto Sans, Noto Emoji, DejaVu Sans, MaterialIcons, Symbola
* xdotool, xsel
* gnupg
* maim, for screenshot
### What is this, Chosto ?
@ -61,6 +62,7 @@ Please note : on my system XDG_CONFIG_HOME is $HOME/.config.
* Clone in bare repository : `git clone --bare https://github.com/Chostakovitch/dotfiles.git $HOME/.cfg`. A bare repository does not have a working tree (basically it is just `.git` content). So we avoid conflicts with another git repository.
* Create a working tree outside `.cfg` : `git --git-dir=$HOME/.cfg/ --work-tree=$HOME checkout`.
* Adjust `DEFAUT_USER` in `~/.zshrc`.
* Adjust other environment variables, such as `SCREENSHOT_PATH`.
* Source `~/.zshrc` and use provided `config` alias to pull.
* `config config --local status.showUntrackedFiles no` to ignore untracked files in status (better as it is home dir).