-
Notifications
You must be signed in to change notification settings - Fork 4
/
onedrive_log
executable file
·27 lines (25 loc) · 1.18 KB
/
onedrive_log
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env bash
black=$(tput setaf 0)
red=$(tput setaf 1)
green=$(tput setaf 2)
yellow=$(tput setaf 3)
blue=$(tput setaf 4)
magenta=$(tput setaf 5)
cyan=$(tput setaf 6)
white=$(tput setaf 7)
normal=$(tput sgr0)
journalctl -o cat --user-unit ${1:-onedrive} -f |
ag -v 'Remaining free space' | # removing unwanted lines from log
sed -u "s/Uploading/$(printf "${blue}Uploading${normal}")/;
s/Successfully created/$(printf "${blue}Successfully created${normal}")/;
s/Downloading/$(printf "${magenta}Downloading${normal}")/;
s/Moving/$(printf "${magenta}Moving${normal}")/;
s/Deleting/$(printf "${yellow}Deleting${normal}")/;
s/deleted/$(printf "${yellow}deleted${normal}")/gI;
" | # changing colors of words
ccze -A -c default=white # | # nice program to colorize log
#>> /tmp/tmp1.txt
# ag --passthru "↗ |Stopping|Stopped|Uploading|Downloading|Error|Deleting"
# s/error/$(printf "${red}❎ERROR${normal}")/gI;
# s/done./$(printf "${green}✔${normal}")/
# tip: bind some key to $TERMINAL -e onedrive_log. really convinient