Skip to content

Commit

Permalink
Update script to use xclip
Browse files Browse the repository at this point in the history
  • Loading branch information
CreativeCodeCat committed Apr 2, 2021
1 parent 955afcb commit 81c4bdd
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
4 changes: 2 additions & 2 deletions git-v1.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
##################################################################################################################
# Author : TheCynicalLiger
# Website : https://github.com/TheCynicalLiger/
# Author : The-Repo-Club
# Website : https://github.com/The-Repo-Club/
##################################################################################################################
#
# DO NOT JUST RUN THIS. EXAMINE AND JUDGE. RUN AT YOUR OWN RISK.
Expand Down
6 changes: 3 additions & 3 deletions setup-git-v1.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
##################################################################################################################
# Author : TheCynicalLiger
# Website : https://github.com/TheCynicalLiger/
# Author : The-Repo-Club
# Website : https://github.com/The-Repo-Club/
##################################################################################################################
#
# DO NOT JUST RUN THIS. EXAMINE AND JUDGE. RUN AT YOUR OWN RISK.
Expand All @@ -25,7 +25,7 @@
#https://www.atlassian.com/git/tutorials/setting-up-a-repository/git-config

git init
git config --global user.name " TheCynicalLiger"
git config --global user.name " The-Repo-Club"
git config --global user.email "wayne6324@gmail.com"
sudo git config --system core.editor nano
git config --global credential.helper cache
Expand Down
21 changes: 15 additions & 6 deletions usr/bin/i3-maim
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
# simple screenshot-script using maim.

_conf=$HOME/.config/i3/i3-maim.conf
_name=$(date +%s)

if ! [ -f $_conf ]; then
echo "maim_dir=$(xdg-user-dir PICTURES)" > $_conf
echo "maim_dir=$(xdg-user-dir PICTURES)" >> $_conf
echo "xclip_cmd=true" >> $_conf
fi

source $_conf
Expand All @@ -15,6 +17,12 @@ if ! [ -d $maim_dir ]; then
mkdir -p $maim_dir
fi

if ! [ -z $xclip_cmd ]; then
clip="xclip -selection clipboard -t image/png $maim_dir/$_name.png"
else
clip=""
fi

if ! [[ -z "$2" ]]; then
cmd="maim -d $2"
else
Expand All @@ -23,19 +31,20 @@ fi

case "$1" in
--fullscreen|-f|$NULL)
$cmd "$maim_dir/$(date +%s).png" &&
$cmd "$maim_dir/$_name.png" && $clip &&
sleep 1 &&
notify-send "screenshot has been saved in $maim_dir" -a "i3-maim"
;;
--window|-w)
$cmd -i $(xdotool getactivewindow) "$maim_dir/$(date +%s).png" &&
$cmd -i $(xdotool getactivewindow) "$maim_dir/$_name.png" && $clip &&
sleep 1 &&
notify-send "screenshot has been saved in $maim_dir" -a "i3-maim"
;;
--select|-s)
notify-send 'select an area for the screenshot' -a "i3-maim" &
$cmd -s "$maim_dir/$(date +%s).png" &&
sleep 1 && notify-send "screenshot has been saved in $maim_dir" -a "i3-maim"
notify-send 'select an area for the screenshot' -a "i3-maim" &&
$cmd -s "$maim_dir/$_name.png" && $clip &&
sleep 1 &&
notify-send "screenshot has been saved in $maim_dir" -a "i3-maim"
;;
--help|-h)
echo "
Expand Down

0 comments on commit 81c4bdd

Please sign in to comment.