Commit b09372a
xxwhirlpool
·
2025-12-18 17:09:06 -0500 EST
parent 9d84096
split crontabs, consolidate screenshot scripts
7 files changed,
+24,
-69
+3,
-0
| ... | ... | @@ -0,0 +1,3 @@ | |
| 1 | + | 0 */3 * * * vdirsyncer sync | |
| 2 | + | ||
| 3 | + | 0 0 * * * crontab -l > /home/kat/dotfiles/config/.crontab-laptop |
+3,
-0
| ... | ... | @@ -0,0 +1,3 @@ | |
| 1 | + | 0 */3 * * * vdirsyncer sync | |
| 2 | + | ||
| 3 | + | 0 0 * * * crontab -l > /home/kat/dotfiles/config/.crontab-pc |
+9,
-1
| ... | ... | @@ -5,7 +5,15 @@ | |
| 5 | 5 | # https://github.com/BreadOnPenguins/scripts/blob/master/screenshot_extra_features | |
| 6 | 6 | ||
| 7 | 7 | export DISPLAY=:0 | |
| 8 | - | SHOTPATH="/media/kat/disk/Pictures/Screenshots" | |
| 8 | + | ||
| 9 | + | if [[ $(hostname) == "mariposa" ]]; then | |
| 10 | + | SHOTPATH="/home/kat/Pictures/Screenshots" | |
| 11 | + | elif [[ $(hostname) == "kwangya" ]]; then | |
| 12 | + | SHOTPATH="/media/kat/disk/Pictures/Screenshots" | |
| 13 | + | else | |
| 14 | + | echo "fuck" | |
| 15 | + | fi | |
| 16 | + | ||
| 9 | 17 | COUNT=$(find $SHOTPATH -type f -printf x | wc -c | awk '{print $1+2}' | awk '{printf "%04d\n", $0}') | |
| 10 | 18 | FILE="$SHOTPATH/$COUNT.png" | |
| 11 | 19 |
+0,
-18
| ... | ... | @@ -1,18 +0,0 @@ | |
| 1 | - | #!/usr/bin/env bash | |
| 2 | - | # | |
| 3 | - | # modified from this GH script: | |
| 4 | - | # | |
| 5 | - | # https://github.com/BreadOnPenguins/scripts/blob/master/screenshot_extra_features | |
| 6 | - | ||
| 7 | - | export DISPLAY=:0 | |
| 8 | - | SHOTPATH="/home/kat/Pictures/Screenshots" | |
| 9 | - | COUNT=$(find $SHOTPATH -type f -printf x | wc -c | awk '{print $1+1}' | awk '{printf "%04d\n", $0}') | |
| 10 | - | FILE="$SHOTPATH/$COUNT.png" | |
| 11 | - | ||
| 12 | - | post () { # copy image to clip & send a notification | |
| 13 | - | xclip -selection clipboard -t image/png -i $FILE && notify-send -i "$FILE" "$FILE copied to clipboard" | |
| 14 | - | } | |
| 15 | - | ||
| 16 | - | import -window root "$FILE" && post || exit 1 | |
| 17 | - | ||
| 18 | - | # notify-send "screenshot taken" "saved as ${FILE} in ${SHOTPATH}" |
+9,
-1
| ... | ... | @@ -5,7 +5,15 @@ | |
| 5 | 5 | # https://github.com/BreadOnPenguins/scripts/blob/master/screenshot_extra_features | |
| 6 | 6 | ||
| 7 | 7 | export DISPLAY=:0 | |
| 8 | - | SHOTPATH="/media/kat/disk/Pictures/Screenshots" | |
| 8 | + | ||
| 9 | + | if [[ $(hostname) == "mariposa" ]]; then | |
| 10 | + | SHOTPATH="/home/kat/Pictures/Screenshots" | |
| 11 | + | elif [[ $(hostname) == "kwangya" ]]; then | |
| 12 | + | SHOTPATH="/media/kat/disk/Pictures/Screenshots" | |
| 13 | + | else | |
| 14 | + | echo "fuck" | |
| 15 | + | fi | |
| 16 | + | ||
| 9 | 17 | COUNT=$(find $SHOTPATH -type f -printf x | wc -c | awk '{print $1+2}' | awk '{printf "%04d\n", $0}') | |
| 10 | 18 | FILE="$SHOTPATH/$COUNT.png" | |
| 11 | 19 |
+0,
-22
| ... | ... | @@ -1,22 +0,0 @@ | |
| 1 | - | #!/usr/bin/env bash | |
| 2 | - | ||
| 3 | - | # modified from this GH script: | |
| 4 | - | # | |
| 5 | - | # https://github.com/BreadOnPenguins/scripts/blob/master/screenshot_extra_features | |
| 6 | - | ||
| 7 | - | export DISPLAY=:0 | |
| 8 | - | SHOTPATH="/home/kat/Pictures/Screenshots" | |
| 9 | - | COUNT=$(find $SHOTPATH -type f -printf x | wc -c | awk '{print $1+1}' | awk '{printf "%04d\n", $0}') | |
| 10 | - | FILE="$SHOTPATH/$COUNT.png" | |
| 11 | - | ||
| 12 | - | ||
| 13 | - | selection () { # draw a selection, or click to select a window | |
| 14 | - | import "$FILE" && post | |
| 15 | - | } | |
| 16 | - | ||
| 17 | - | ||
| 18 | - | post () { # copy image to clip & send a notification | |
| 19 | - | xclip -selection clipboard -t image/png -i $FILE && notify-send -i "$FILE" "$FILE copied to clipboard" | |
| 20 | - | } | |
| 21 | - | ||
| 22 | - | selection |
+0,
-27
| ... | ... | @@ -1,27 +0,0 @@ | |
| 1 | - | # Edit this file to introduce tasks to be run by cron. | |
| 2 | - | # | |
| 3 | - | # Each task to run has to be defined through a single line | |
| 4 | - | # indicating with different fields when the task will be run | |
| 5 | - | # and what command to run for the task | |
| 6 | - | # | |
| 7 | - | # To define the time you can provide concrete values for | |
| 8 | - | # minute (m), hour (h), day of month (dom), month (mon), | |
| 9 | - | # and day of week (dow) or use '*' in these fields (for 'any'). | |
| 10 | - | # | |
| 11 | - | # Notice that tasks will be started based on the cron's system | |
| 12 | - | # daemon's notion of time and timezones. | |
| 13 | - | # | |
| 14 | - | # Output of the crontab jobs (including errors) is sent through | |
| 15 | - | # email to the user the crontab file belongs to (unless redirected). | |
| 16 | - | # | |
| 17 | - | # For example, you can run a backup of all your user accounts | |
| 18 | - | # at 5 a.m every week with: | |
| 19 | - | # 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/ | |
| 20 | - | # | |
| 21 | - | # For more information see the manual pages of crontab(5) and cron(8) | |
| 22 | - | # | |
| 23 | - | # m h dom mon dow command | |
| 24 | - | ||
| 25 | - | 0 */3 * * * vdirsyncer sync | |
| 26 | - | ||
| 27 | - | 0 0 * * * crontab -l > /home/kat/dotfiles/config/crontab |