From 2f6c079bb21469bd24f1b7fb87fbb24b3b2b623f Mon Sep 17 00:00:00 2001 From: Gregor Feierabend <23300469@sun.ac.za> Date: Tue, 29 Jun 2021 01:21:14 +0200 Subject: [PATCH] added mail notification --- .Xresources | 2 +- .compton.conf | 12 ++++++++++-- .config/cmus/autosave | 2 +- .config/i3/config | 8 +++++--- .config/i3/i3blocks.conf | 29 +++++++++++++++++++++++++++-- .config/i3/scripts/emulator.sh | 4 ---- .config/i3/scripts/xrate.py | 3 ++- .config/zathura/zathurarc | 1 + .muttrc | 2 ++ .ratpoisonrc | 3 ++- .sage/init.sage | 5 +++++ .scripts/adbreconnect.sh | 4 +++- .scripts/headless.sh | 8 +++++++- .scripts/mailnotify.sh | 8 ++++++++ .uncrustify.cfg | 14 +++++++------- .vimrc | 8 +++++++- .zshrc | 1 + 17 files changed, 89 insertions(+), 25 deletions(-) delete mode 100755 .config/i3/scripts/emulator.sh create mode 100755 .scripts/mailnotify.sh diff --git a/.Xresources b/.Xresources index 82a4d2a..13b5f8e 100755 --- a/.Xresources +++ b/.Xresources @@ -4,7 +4,7 @@ dclock*militaryTime: yes dclock*audioPlay: /usr/bin/sudo dclock*alarmFile: halt -XTerm*reverseVideo: false +XTerm*reverseVideo: true XTerm*loginShell: true XTerm*vt100*translations: #override \n\ F9: set-select(toggle) \n\ diff --git a/.compton.conf b/.compton.conf index 534237a..f047f2f 100644 --- a/.compton.conf +++ b/.compton.conf @@ -1,8 +1,16 @@ -shadow-opacity = 1; +shadow-opacity = 0.8; shadow = true; shadow-radius = 0; shadow-offset-x = -2; shadow-offset-y = -2; shadow-ignore-shaped = true; -shadow-exclude = [ "name = 'Notification'", "class_g = 'Conky'", "class_g ?= 'Notify-osd'", "class_g = 'Cairo-clock'", "class_g = 'Pqiv'", "class_g = 'slop'", "class_g = 'Firefox'", "name = 'xfce4-notifyd'"]; +shadow-exclude = [ "class_g = 'TelegramDesktop'", + "name = 'Notification'", + "class_g = 'Conky'", + "class_g ?= 'Notify-osd'", + "class_g = 'Cairo-clock'", + "class_g = 'Pqiv'", + "class_g = 'slop'", + "class_g = 'Firefox'", + "name = 'xfce4-notifyd'"]; diff --git a/.config/cmus/autosave b/.config/cmus/autosave index da2908b..9b97060 100644 --- a/.config/cmus/autosave +++ b/.config/cmus/autosave @@ -89,7 +89,7 @@ set mixer.alsa.device= set mixer.pulse.restore_volume=1 set mouse=false set mpris=false -set output_plugin=alsa +set output_plugin=pulse set passwd= set pl_sort= set play_library=false diff --git a/.config/i3/config b/.config/i3/config index 4d7c00e..4c143e2 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -210,8 +210,8 @@ bindsym $mod+Shift+x exec i3lock -c 222222 bindsym $mod+z [class="Zathura"] scratchpad show bindsym $mod+u [class="URxvt"] scratchpad show bindsym $mod+c [title="Android Emulator*"] scratchpad show -bindsym $mod+Shift+w exec zsh ~/.config/i3/scripts/emulator.sh -bindsym $mod+Shift+m exec zsh ~/.config/i3/scripts/emulator_snap.sh +#bindsym $mod+Shift+w exec zsh ~/.config/i3/scripts/emulator.sh +#bindsym $mod+Shift+m exec zsh ~/.config/i3/scripts/emulator_snap.sh #bindsym $mod+t exec transset -n `xdotool getwindowfocus getwindowname` --dec 0.2 #bindsym $mod+Shift+t exec transset -n `xdotool getwindowfocus getwindowname` --inc 0.2 bindsym $mod+t exec zsh ~/.config/i3/scripts/incop.sh @@ -223,12 +223,14 @@ bindsym $mod+x move absolute position center bindsym $mod+i exec xrandr-invert-colors bindsym $mod+p exec pqiv -c -c -i ~/ANNOTATIONS bindsym $mod+b exec zsh ~/.config/i3/scripts/screencut.sh +bindsym $mod+Shift+w exec ~/.scripts/adbreconnect.sh +bindsym $mod+Shift+f exec firefox -P Work -no-remote for_window [class="URxvt" floating] resize set 1400 850 for_window [class="URxvt"] move absolute position center for_window [class="Pqiv"] floating enable for_window [class="Dclock"] floating enable -for_window [title="^Skype$"] floating enable +#for_window [title="^Skype$"] floating enable for_window [title="Typora$"] fullscreen disable for_window [title="^Emulator$"] move scratchpad for_window [title="Android Emulator - thePhone:5554"] resize set 375 667 diff --git a/.config/i3/i3blocks.conf b/.config/i3/i3blocks.conf index 7a36b54..5a6a13b 100644 --- a/.config/i3/i3blocks.conf +++ b/.config/i3/i3blocks.conf @@ -10,8 +10,23 @@ #color=#A4C2F4 # exchange rate(s) -[xrate] -command=~/.config/i3/scripts/xrate.py +[xrateEURZAR] +command=~/.config/i3/scripts/xrate.py EURZAR=X +interval=3600 +color=#A4C2F4 + +[xrateSGDZAR] +command=~/.config/i3/scripts/xrate.py SGDZAR=X +interval=3600 +color=#A4C2F4 + +[xrateEURCHF] +command=~/.config/i3/scripts/xrate.py EURCHF=X +interval=3600 +color=#A4C2F4 + +[xrateSGDEUR] +command=~/.config/i3/scripts/xrate.py SGDEUR=X interval=3600 color=#A4C2F4 @@ -22,6 +37,16 @@ command=curl -s ipinfo.io | awk '/city/ { split($0, e, "\""); print e[4]; }' interval=3600 color=#91E78B +[wifi] +command=wpa_cli status | grep ^ssid +interval=10 +color=#A4C2F4 + +[mail] +command=~/.scripts/mailnotify.sh +interval=60 +color=#91E78B + # Update time every 5 seconds [time] command=date +%T diff --git a/.config/i3/scripts/emulator.sh b/.config/i3/scripts/emulator.sh deleted file mode 100755 index ab07f4a..0000000 --- a/.config/i3/scripts/emulator.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/zsh -emulator -accel on -avd thePhone -gpu host -camera-back webcam1 -camera-front webcam1 -delay-adb -no-boot-anim -no-snapshot-load -#emulator -accel on -avd thePhone -gpu host -camera-back webcam1 -camera-front webcam1 -delay-adb -no-boot-anim -no-window -adb kill-server diff --git a/.config/i3/scripts/xrate.py b/.config/i3/scripts/xrate.py index f3b55bb..c65ddb0 100755 --- a/.config/i3/scripts/xrate.py +++ b/.config/i3/scripts/xrate.py @@ -1,5 +1,6 @@ #!/usr/bin/python3.8 import yfinance as yf -eurzar = yf.Ticker('EURZAR=X') +import sys +eurzar = yf.Ticker(sys.argv[1]) print(round(eurzar.history(period="1m").Close.to_list()[0], 4)) diff --git a/.config/zathura/zathurarc b/.config/zathura/zathurarc index f2f7d40..a98a55c 100644 --- a/.config/zathura/zathurarc +++ b/.config/zathura/zathurarc @@ -1,2 +1,3 @@ set first-page-column 1:1 set scroll-hstep 0 +set synctex true diff --git a/.muttrc b/.muttrc index 239a14c..2bc3e14 100644 --- a/.muttrc +++ b/.muttrc @@ -89,3 +89,5 @@ set message_cachedir="~/MAIL/muttmcache/" set header_cache="~/MAIL/mutthcache/" source ~/MAIL/muttrc.mailboxes source ~/MAIL/muttrc.aliases +alias rianaroux \"Roux, Riana [rianaroux@sun.ac.za]\" +alias Dario Dario <20854714@sun.ac.za> diff --git a/.ratpoisonrc b/.ratpoisonrc index 0dfab1b..6079783 100644 --- a/.ratpoisonrc +++ b/.ratpoisonrc @@ -8,7 +8,8 @@ bind C-c exec urxvt exec fbsetroot -solid black exec xrdb ~/.Xresources -exec /usr/lib64/xfce4/notifyd/xfce4-notifyd +#exec /usr/lib64/xfce4/notifyd/xfce4-notifyd +exec dunst exec redshift -l -18:33 exec unclutter -idle 5 -jitter 20 #exec /usr/bin/xbattbar -a -c -t 2 -I "#333333" -O white -i white -o "#333333" diff --git a/.sage/init.sage b/.sage/init.sage index 8466c47..96d78b0 100644 --- a/.sage/init.sage +++ b/.sage/init.sage @@ -1 +1,6 @@ %colors Linux + +def division(dividend, divisor): + return (dividend._maxima_().divide(divisor).sage()) + +#for pole in (1/f == 0).solve(z):f(z).maxima_methods().residue(z,pole.rhs()) diff --git a/.scripts/adbreconnect.sh b/.scripts/adbreconnect.sh index 83c2470..c923dec 100755 --- a/.scripts/adbreconnect.sh +++ b/.scripts/adbreconnect.sh @@ -1 +1,3 @@ -adb root && adb shell svc data disable && adb shell svc data enable +adb root +adb shell svc data disable && adb shell svc wifi disable +adb shell svc data enable && adb shell svc data enable diff --git a/.scripts/headless.sh b/.scripts/headless.sh index 8bcdbe4..4dc3595 100755 --- a/.scripts/headless.sh +++ b/.scripts/headless.sh @@ -1,5 +1,11 @@ #!/bin/zsh +export ANDROID_SDK=/opt/android-sdk-update-manager +export PATH=$ANDROID_SDK/emulator:$ANDROID_SDK/tools:$PATH + #emulator -accel on -avd thePhone -gpu host -delay-adb -no-boot-anim -no-window -no-snapshot-load -detect-image-hang -emulator -accel on -avd thePhone -gpu host -delay-adb -no-boot-anim -no-window -detect-image-hang -use-system-libs -cores 4 +#emulator -accel on -avd thePhone -gpu host -delay-adb -no-boot-anim -no-window -no-snapshot-load -detect-image-hang -use-system-libs -cores 4 #emulator -accel on -avd thePhone -gpu host -delay-adb -no-boot-anim -no-window + +emulator -accel on -avd thePhone -gpu host -no-boot-anim -no-window -no-snapshot-load + adb kill-server diff --git a/.scripts/mailnotify.sh b/.scripts/mailnotify.sh new file mode 100755 index 0000000..8b001fc --- /dev/null +++ b/.scripts/mailnotify.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +ml="$(find $HOME/MAIL/offlineIMAP/*/INBOX/new -type f | wc -l)" +if (( ml > 0 )); then + echo $ml +else + echo "0" +fi diff --git a/.uncrustify.cfg b/.uncrustify.cfg index 41d4ab3..b4566f6 100755 --- a/.uncrustify.cfg +++ b/.uncrustify.cfg @@ -283,7 +283,7 @@ nl_assign_leave_one_liners = false nl_class_leave_one_liners = false nl_enum_leave_one_liners = false nl_getset_leave_one_liners = false -nl_func_leave_one_liners = true +nl_func_leave_one_liners = false nl_cpp_lambda_leave_one_liners = false nl_if_leave_one_liners = true nl_while_leave_one_liners = true @@ -469,12 +469,12 @@ pos_constr_comma = ignore pos_class_colon = ignore pos_constr_colon = ignore code_width = 80 -ls_for_split_full = false -ls_func_split_full = false -ls_code_width = false +ls_for_split_full = true +ls_func_split_full = true +ls_code_width = true align_keep_tabs = false -align_with_tabs = false -align_on_tabstop = false +align_with_tabs = true +align_on_tabstop = true align_number_right = false align_keep_extra_space = false align_func_params = false @@ -590,7 +590,7 @@ pp_indent = ignore pp_indent_at_level = false pp_indent_count = 1 pp_space = ignore -pp_space_count = 0 +pp_space_count = 1 pp_indent_region = 0 pp_region_indent_code = false pp_indent_if = 0 diff --git a/.vimrc b/.vimrc index 1717f11..b1bbe8b 100644 --- a/.vimrc +++ b/.vimrc @@ -33,6 +33,8 @@ set listchars=eol:¬,tab:>·,trail:~,extends:>,precedes:<,space:␣ set textwidth=80 set tags=./tags,./TAGS,tags,TAGS +set nojoinspaces + map gn :bn map gp :bp "map "zyiw :tjump z @@ -165,6 +167,8 @@ let g:syntastic_tex_lacheck_quiet_messages = {"regex": ['.*unmatched.*', map :lprev map :lnext +autocmd FileType c set formatprg=uncrustify\ -l\ c\ --frag\ -q + """""""""""""""""""""""""""""""""""""" VIMUX """"""""""""""""""""""""""""""""""" "https://github.com/preservim/vimux.git @@ -210,11 +214,13 @@ let g:Tex_Com_std = "\\title{}\n\\author{}\n\\date{}\n\\documentclass[a4paper," autocmd BufNewFile,BufRead *.tex set syntax=plaintex autocmd BufNewFile,BufRead *.tex syntax match Comment "%.*" autocmd BufNewFile,BufRead *.tex set textwidth=80 +autocmd BufNewFile,BufRead *.tex let g:syntastic_auto_jump = 0 imap :let b:Imap_FreezeImap = 1 imap :let b:Imap_FreezeImap = 0 imap :w:!pdflatex % -nmap :w:!pdflatex --shell-escape % +"nmap :w:!pdflatex --shell-escape % +nmap :w:!pdflatex % nmap :!zathura $(basename % .tex).pdf & imap :w:!biber -E utf8 $(basename % .tex) nmap :w:!biber -E utf8 $(basename % .tex) diff --git a/.zshrc b/.zshrc index ade8062..5f2c499 100644 --- a/.zshrc +++ b/.zshrc @@ -29,6 +29,7 @@ export VISUAL=vim export EDITOR=vim export SCIPY_PIL_IMAGE_VIEWER=imv export CHKTEXRC=~ +export SAGE_BROWSER=/usr/bin/firefox autoload -z edit-command-line zle -N edit-command-line