diff --git a/dotfiles/bash.org b/dotfiles/bash.org index c10e069..8605370 100644 --- a/dotfiles/bash.org +++ b/dotfiles/bash.org @@ -372,7 +372,7 @@ Force prompt to write history after every command. http://superuser.com/question ** Gui program to ask for sudo password #+begin_src bash - export SUDO_ASKPASS=~/bin/askpass-rofi + export SUDO_ASKPASS=~/.local/bin/askpass-rofi #+END_SRC ** Gnome Keyring Daemon @@ -423,7 +423,7 @@ Force prompt to write history after every command. http://superuser.com/question PATH=$HOME/appimages:$PATH PATH=$HOME/.gem/ruby/2.5.0/bin:$PATH PATH=$GOPATH:$GOPATH/bin:$PATH - PATH=~/bin:$PATH + PATH=~/.local/bin:$PATH PATH=~/.emacs.d/bin:$PATH export PATH #+END_SRC diff --git a/dotfiles/binaries.org b/dotfiles/binaries.org index 72aa239..3a51292 100644 --- a/dotfiles/binaries.org +++ b/dotfiles/binaries.org @@ -23,7 +23,7 @@ * =displayselect= - Select Screen Script taken from Luke Smith. -#+begin_src bash :tangle ~/bin/displayselect +#+begin_src bash :tangle ~/.local/bin/displayselect twoscreen() { # If multi-monitor is selected and there are two screens. mirror=$(printf "no\\nyes" | dmenu -i -p "Mirror displays?") @@ -94,7 +94,7 @@ Script taken from Luke Smith. * TODO =getbib= -#+begin_src bash :tangle ~/bin/getbib +#+begin_src bash :tangle ~/.local/bin/getbib [ -z "$1" ] && echo "Give either a pdf file or a DOI as an argument." && exit if [ -f "$1" ]; then @@ -112,11 +112,11 @@ Script taken from Luke Smith. * =vpntoggle= - Connect to VPN using NordVPN -#+begin_src bash :tangle ~/bin/vpntoggle +#+begin_src bash :tangle ~/.local/bin/vpntoggle if [[ $(nordvpn status) == *"Connected"* ]]; then nordvpn disconnect && dunstify --replace=23198 "VPN" "Disconnected"; else - country=`cat ~/bin/nordvpn_countries.txt | sed 's/\s*\t\s*/ /g ; s/\s/\n/g ; s/_/ /g ; /^[a-zA-Z]/!d ; s/\(.*\)/\L\1/' | rofi -i -dmenu | sed 's/\s/_/g'`; + country=`cat ~/.local/data/nordvpn_countries.txt | sed 's/\s*\t\s*/ /g ; s/\s/\n/g ; s/_/ /g ; /^[a-zA-Z]/!d ; s/\(.*\)/\L\1/' | rofi -i -dmenu | sed 's/\s/_/g'`; dunstify --replace=23198 "VPN" "Connecting to $country..."; nordvpn connect $country && dunstify --replace=23198 "VPN" "Connected to $country"; fi @@ -124,7 +124,7 @@ Script taken from Luke Smith. * =bukurun= - Open link from Buku -#+begin_src bash :tangle ~/bin/bukurun +#+begin_src bash :tangle ~/.local/bin/bukurun _rofi () { rofi -dmenu -i -no-levenshtein-sort -width 1000 "$@" } @@ -459,11 +459,11 @@ mode=bookmarks main * =i3exit= - Manage lock, suspend, reboot, ... -#+begin_src bash :tangle ~/bin/i3exit +#+begin_src bash :tangle ~/.local/bin/i3exit # with openrc use loginctl case "$1" in lock) - ~/scripts/lockscreen.sh + ~/.local/bin/lockscreen ;; logout) loginctl terminate-session `loginctl session-status | head -n 1 | awk '{print $1}'` @@ -472,10 +472,10 @@ mode=bookmarks main dm-tool switch-to-greeter ;; suspend) - systemctl suspend && ~/scripts/lockscreen.sh + systemctl suspend && ~/.local/bin/lockscreen ;; hibernate) - systemctl hibernate && ~/scripts/lockscreen.sh + systemctl hibernate && ~/.local/bin/lockscreen ;; reboot) systemctl reboot @@ -494,22 +494,22 @@ mode=bookmarks main * =readbib= - Open Bibliography File -#+begin_src bash :tangle ~/bin/readbib +#+begin_src bash :tangle ~/.local/bin/readbib cd ~/Cloud/thesis/ressources/pdfs/ && ls | rofi -dmenu -lines 20 | xargs -I {} zathura {} #+end_src * =readnotes= - Open Note File -#+begin_src bash :tangle ~/bin/readnotes +#+begin_src bash :tangle ~/.local/bin/readnotes cd ~/Cloud/thesis/ressources/notes/pdfs/ && ls *.pdf | rofi -dmenu -lines 20 | xargs -I {} zathura {} #+end_src -* TODO askpass +* TODO =askpass-rofi= - askpass - [ ] Should be a script Take password prompt from STDIN, print password to STDOUT. The sed piece just removes the colon from the provided prompt: =rofi -p= already gives us a colon -#+BEGIN_SRC bash :tangle ~/bin/askpass-rofi +#+BEGIN_SRC bash :tangle ~/.local/bin/askpass-rofi rofi -dmenu \ -password \ -no-fixed-num-lines \ @@ -518,7 +518,7 @@ The sed piece just removes the colon from the provided prompt: =rofi -p= already * =screenshot= - Take Screenshot -#+begin_src bash :tangle ~/bin/screenshot +#+begin_src bash :tangle ~/.local/bin/screenshot status=$(echo -e "All\nGUI\nSelection\nCropped\nCopy\nShadow\nActive" | rofi -i -dmenu -p "Type") if [ -z "$status" ]; then exit; @@ -549,7 +549,7 @@ The sed piece just removes the colon from the provided prompt: =rofi -p= already * =remote-desktop= - Remote Desktop Connect -#+begin_src bash :tangle ~/bin/remote-desktop +#+begin_src bash :tangle ~/.local/bin/remote-desktop computer=$(echo -e 'RNICE\nPCMEL1\nPCNASS1\nPCMEG01' | dmenu -p 'Computer:' -l 20); case $computer in @@ -573,7 +573,7 @@ The sed piece just removes the colon from the provided prompt: =rofi -p= already * =network-toggle= - Toggle Network -#+begin_src bash :tangle ~/bin/network-toggle +#+begin_src bash :tangle ~/.local/bin/network-toggle result=$(nmcli device | sed '1d' | dmenu -l 20); interface=$(echo $result | awk -F ' ' '{print $1}'); @@ -588,7 +588,7 @@ The sed piece just removes the colon from the provided prompt: =rofi -p= already * =print-rnice= - Print on Rnice -#+begin_src bash :tangle ~/bin/print-rnice +#+begin_src bash :tangle ~/.local/bin/print-rnice nbpage=$(echo -e '1\n2\n4' | dmenu -p 'Number of pages per sheet' -l 20); sides=$(echo -e 'one-sided\ntwo-sided-long-edge\ntwo-sided-short-edge' | dmenu -p 'Two Sided:' -l 20); @@ -602,10 +602,10 @@ The sed piece just removes the colon from the provided prompt: =rofi -p= already fi #+end_src -* TODO Mount TMP14DAYS +* TODO =mnt_tmp_14_days= - Mount TMP14DAYS - [ ] Put that as a script? -#+begin_src bash :tangle ~/bin/mnt_tmp_14_days +#+begin_src bash :tangle ~/.local/bin/mnt_tmp_14_days sudo -A mkdir ~/tmp_14_days; sudo -A mount -o rw,relatime,vers=3,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=160.103.232.103,mountvers=3,mountport=597,mountproto=tcp,local_lock=none,addr=160.103.232.103 rnice:/hz/tmp_14_days ~/tmp_14_days; #+end_src @@ -613,7 +613,7 @@ The sed piece just removes the colon from the provided prompt: =rofi -p= already * =make-gif= - Make GIF http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html -#+begin_src bash :tangle ~/bin/make-gif +#+begin_src bash :tangle ~/.local/bin/make-gif palette="/tmp/palette.png" filters="fps=15,scale=320:-1:flags=lanczos" @@ -623,7 +623,7 @@ http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html #+end_src * =yt-audio= - Download-Audio from youtube -#+begin_src bash :tangle ~/bin/yt-audio +#+begin_src bash :tangle ~/.local/bin/yt-audio if [ $TMUX ]; then tmux split -v -l 5 "cd ~/Downloads/ && youtube-dl --add-metadata -xic -f bestaudio/best $1" && tmux select-pane -U else @@ -634,7 +634,7 @@ fi * =yt-video= - Download-Video from youtube -#+begin_src bash :tangle ~/bin/yt-video +#+begin_src bash :tangle ~/.local/bin/yt-video if [ $TMUX ]; then tmux split -v -l 5 "cd ~/Downloads/ && youtube-dl --add-metadata -ic $1" && tmux select-pane -U else @@ -644,7 +644,7 @@ fi #+end_src * =pdf-shrink= Pdf Shrink -#+begin_src bash :tangle ~/bin/pdf-shrink +#+begin_src bash :tangle ~/.local/bin/pdf-shrink shrink () { gs \ @@ -715,7 +715,7 @@ fi #+end_src * =setbg= - Set Background -#+begin_src bash :tangle ~/bin/setbg +#+begin_src bash :tangle ~/.local/bin/setbg bgloc="${XDG_CACHE_HOME:-$HOME/.cache/}/bg" [ -f "$1" ] && ln -sf "$(readlink -f "$1")" "$bgloc" @@ -724,13 +724,13 @@ fi xwallpaper --zoom "$bgloc" #+end_src -* Insert Unicode Icon +* =insert-unicode= - Insert Unicode Icon -#+begin_src bash :tangle ~/bin/insert-unicode +#+begin_src bash :tangle ~/.local/bin/insert-unicode # Must have xclip installed to even show menu. xclip -h 2>/dev/null || exit 1 - chosen=$(cut -d ';' -f1 ~/.local/share/emoji | rofi -dmenu -i -l 20 | sed "s/ .*//") + chosen=$(cut -d ';' -f1 ~/.local/data/emoji | rofi -dmenu -i -l 20 | sed "s/ .*//") [ "$chosen" != "" ] || exit @@ -743,13 +743,13 @@ fi fi #+end_src -* Insert Nerd Font Icon +* =insert-nerd-fonts= - Insert Nerd Font Icon -#+begin_src bash :tangle ~/bin/insert-nerd-fonts +#+begin_src bash :tangle ~/.local/bin/insert-nerd-fonts # Must have xsel installed to even show menu. xsel -h 2>/dev/null || exit 1 - chosen=$(cat ~/.local/share/nerd-fonts | rofi -dmenu -i -l 20 | sed "s/ .*//") + chosen=$(cat ~/.local/data/nerd-fonts | rofi -dmenu -i -l 20 | sed "s/ .*//") [ "$chosen" != "" ] || exit @@ -761,6 +761,7 @@ fi dunstify "'$chosen' copied to clipboard." & fi #+end_src + * =nas= - Interact with the NAS As an alternative, =sshfs= can be used: @@ -768,7 +769,7 @@ As an alternative, =sshfs= can be used: sshfs -o allow_other,default_permissions nas:/Data ~/mnt/NAS #+end_src -#+begin_src bash :tangle ~/bin/nas +#+begin_src bash :tangle ~/.local/bin/nas if [ $1 == "mount" ]; then if mount /home/thomas/mnt/NAS/; then dunstify --replace=58249 'NAS ' 'Successfully mounted' @@ -783,3 +784,139 @@ As an alternative, =sshfs= can be used: fi fi #+end_src + +* =linkhandler= - Open with Default application +Inspired from =linkhandler= https://github.com/LukeSmithxyz/voidrice/ +This is used in =newsboat= to handle links + +#+begin_src bash :tangle ~/.local/bin/linkhandler + [ -z "$1" ] && { "$BROWSER"; exit; } + + case "$1" in + ,*mkv|*webm|*mp4|*youtube.com/watch*|*youtube.com/playlist*|*youtu.be*|*hooktube.com*|*bitchute.com*) + setsid mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) -quiet "$1" >/dev/null 2>&1 & ;; + ,*png|*jpg|*jpe|*jpeg|*gif) + curl -sL "$1" > "/tmp/$(echo "$1" | sed "s/.*\///")" && sxiv -a "/tmp/$(echo "$1" | sed "s/.*\///")" >/dev/null 2>&1 & ;; + ,*mp3|*flac|*opus|*mp3?source*) + setsid tsp curl -LO "$1" >/dev/null 2>&1 & ;; + ,*) + if [ -f "$1" ]; then "$TERMINAL" -e "$EDITOR $1" + else setsid $BROWSER "$1" >/dev/null 2>&1 & fi ;; + esac +#+end_src +* =lockscreen= - LockScreen +:PROPERTIES: +:header-args: :tangle ~/.local/bin/lockscreen +:END: + +First, turn off dunst +#+begin_src bash + killall -SIGUSR1 dunst && echo "off" > /tmp/dunststatus; +#+end_src + +Turn off the music if it is playing. +#+begin_src bash + MPC_STATE=$(mpc | sed -n '2p' | cut -d "[" -f2 | cut -d "]" -f1) + if [[ $MPC_STATE == "playing" ]]; then + mpc pause + fi +#+end_src + +Then take a screenshot and process it. +#+begin_src bash + temp_file="/tmp/screen.png" + + rm -f $temp_file + + maim $temp_file + convert $temp_file -scale 10% -scale 1000% $temp_file +#+end_src + +Finally, lock the screen using =i3lock=. +#+begin_src bash + i3lock --no-unlock-indicator --ignore-empty-password --nofork --image=$temp_file && killall -SIGUSR2 dunst && echo "on" > /tmp/dunststatus +#+end_src + +#+begin_src bash :tangle no + revert() { + xset dpms 0 0 0 + } + trap revert HUP INT TERM + # turn off screen after 5 seconds + xset +dpms dpms 5 5 5 + + # Parameters + temp_file="/tmp/screen.png" + icon="$HOME/Pictures/Evil_Rick_Sprite.png" + width=1920 + height=1080 + blur_factor=6 + lock_blur_factor=0 + + # Take the screen shot, blur the image and add the icon + ffmpeg -f x11grab -video_size "${width}x${height}" -y -i $DISPLAY -i $icon -filter_complex "boxblur=$blur_factor:$blur_factor,overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2,boxblur=$lock_blur_factor:$lock_blur_factor" -vframes 1 $temp_file + + # Alternative + # maim -d 1 $temp_file + # convert -blur 0x8 $temp_file $temp_file + # convert -composite $temp_file $icon -gravity South -geometry -20x1200 $temp_file + + # Lock the screen with the image + i3lock --no-unlock-indicator --ignore-empty-password --show-failed-attempts --nofork --image=$temp_file + + # Remove the screenshot + rm $temp_file + + # Don't turn off screen when back from lock + revert +#+end_src + +* TODO =quit= - Lock / Exit / Suspend / ... +- [ ] Seems duplicated with [[file:binaries.org::*=i3exit= - Manage lock, suspend, reboot, ...][=i3exit= - Manage lock, suspend, reboot, ...]] +- [ ] Also change the binary name + +#+begin_src bash :tangle ~/.local/bin/quit + option=$(echo -e "Lock\nExit\nLogout\nSuspend\nHibernate\nReboot\nShutdown" | rofi -i -dmenu) + + case "$option" in + "Lock") + i3exit lock ;; + "Exit") + i3exit switch_user ;; + "Logout") + i3exit logout ;; + "Suspend") + i3exit suspend ;; + "Hibernate") + i3exit hibernate ;; + "Reboot") + i3exit reboot ;; + "Shutdown") + i3exit shutdown ;; + esac +#+end_src + +* =torrent-add= - Download Torrent + +#+begin_src bash :tangle ~/.local/bin/torrent-add + transmission-remote 82.64.103.2:9091 --auth tdehaeze:$(pass nas/transmission | sed -n 1p) -a $1 && \ + dunstify 'Torrent' 'Successfully added' || \ + dunstify 'Torrent' 'Error' + +#+end_src + +* =mopidy-restart= - Restart Mopidy +#+begin_src bash :tangle ~/.local/bin/mopidy-restart + pids=( $(pgrep -f mopidy) ) + + for pid in "${pids[@]}"; do + if [[ $pid != $$ ]]; then + kill "$pid" + fi + done + + echo "Killed mopidy." + echo "Restarting mopidy..." + mopidy --config ~/.config/mopidy/mopidy.conf >/dev/null 2>&1 & + echo "Done" +#+end_src diff --git a/dotfiles/data.org b/dotfiles/data.org index 34461e6..c159765 100644 --- a/dotfiles/data.org +++ b/dotfiles/data.org @@ -1,4 +1,4 @@ -#+TITLE: Scripts +#+TITLE: Data :DRAWER: #+STARTUP: overview @@ -20,7 +20,7 @@ :END: * Nerd Fonts -#+begin_src conf :tangle ~/.local/share/nerd-fonts +#+begin_src conf :tangle ~/.local/data/nerd-fonts  - i_dev_bing_small  - i_dev_css_tricks  - i_dev_git @@ -1303,7 +1303,8 @@  - i_custom_vim #+end_src * Emojis -#+begin_src conf :tangle ~/.local/share/emojis😀 grinning face; U+1F600 +#+begin_src conf :tangle ~/.local/data/emojis + 😀 grinning face; U+1F600 😃 grinning face with big eyes; U+1F603 😄 grinning face with smiling eyes; U+1F604 😁 beaming face with smiling eyes; U+1F601 diff --git a/dotfiles/doom.org b/dotfiles/doom.org index d8b78f8..8f68771 100644 --- a/dotfiles/doom.org +++ b/dotfiles/doom.org @@ -2637,7 +2637,7 @@ Choose account label to feed msmtp -a option based on From header in Message buf #+begin_src emacs-lisp (use-package! mu4e :config - (setq mu4e-get-mail-command "~/scripts/checkmail.sh" + (setq mu4e-get-mail-command "checkmail" mu4e-update-interval nil mu4e-change-filenames-when-moving t) ;; Fix for mbsync ) diff --git a/dotfiles/index.org b/dotfiles/index.org index 6da8ee3..95d0f7d 100644 --- a/dotfiles/index.org +++ b/dotfiles/index.org @@ -64,7 +64,6 @@ The general installation process is described [[file:install.org][here]]. - [[file:applications.org][Desktop Applications]] - [[file:matlab.org][Matlab]] - Some useful [[file:binaries.org][Binaries]] -- Some useful [[file:scripts.org][Scripts]] - [[file:git.org][Git]] Configuration - [[file:gtk.org][GTK]] - [[file:config.org][Other Config]] diff --git a/dotfiles/install.org b/dotfiles/install.org index 34869fc..44d51d6 100644 --- a/dotfiles/install.org +++ b/dotfiles/install.org @@ -251,7 +251,7 @@ Use ~sudo -A~, that will open a rofi prompt to ask for the password. For that to work, we need to add the following code to =~/.profile=: #+begin_src bash - export SUDO_ASKPASS=~/bin/askpass-rofi + export SUDO_ASKPASS=~/.local/bin/askpass-rofi #+end_src The =askpass= script is: @@ -357,8 +357,8 @@ https://github.com/carnager/buku_run *** Installation #+begin_src bash -wget https://raw.githubusercontent.com/carnager/buku_run/master/buku_run -o ~/bin/buku_run -chmod +x ~/bin/buku_run +wget https://raw.githubusercontent.com/carnager/buku_run/master/buku_run -o ~/.local/bin/buku_run +chmod +x ~/.local/bin/buku_run #+end_src *** Configuration @@ -376,7 +376,7 @@ cd ~/.local/share/buku/bookmarks.db git init #+end_src -Then we create a script that will automatically add =bookmarks.db= and push to some repository: =~/scripts/buku_git_push.sh=. +Then we create a script that will automatically add =bookmarks.db= and push to some repository: =buku_git_push=. To automatically run the script every day, a systemd unit is used: =~/.config/systemd/user/bukugit.timer= and =~/.config/systemd/user/bukugit.service= @@ -803,7 +803,7 @@ https://wiki.archlinux.org/index.php/Isync *** Automation using systemd **** Retreive New mails -- =~/scripts/checkmail.sh= +- =checkmail= - =~/.config/systemd/user/checkmail.service= - =~/.config/systemd/user/checkmail.timer= @@ -845,9 +845,6 @@ https://github.com/neomutt/neomutt yay -S w3m #+end_src -*** Open PDF from mail -=~/scripts/openfile.sh= - *** Open Url from mail #+begin_src bash yay -S urlview @@ -859,7 +856,7 @@ https://github.com/neomutt/neomutt - https://github.com/LukeSmithxyz/mutt-wizard ** Notification system -A script (=~/scripts/checkmail.sh=) is used to retreive new mails and use =notify=send= is there are new received mails. +A script (=checkmail=) is used to retreive new mails and use =notify=send= is there are new received mails. * File Manager Configuration files: diff --git a/dotfiles/mail.org b/dotfiles/mail.org index 0fe8c87..bbcd164 100644 --- a/dotfiles/mail.org +++ b/dotfiles/mail.org @@ -26,246 +26,246 @@ http://isync.sourceforge.net/ ** Global Defaults #+BEGIN_SRC conf -# Automatically create missing mailboxes, both locally and on the server -Create Both -# Save the synchronization state files in the relevant directory -SyncState * -# Permanently remove all messages [on the Master/Slave] marked for deletion. -Expunge Both + # Automatically create missing mailboxes, both locally and on the server + Create Both + # Save the synchronization state files in the relevant directory + SyncState * + # Permanently remove all messages [on the Master/Slave] marked for deletion. + Expunge Both #+END_SRC ** Gmail Account #+BEGIN_SRC conf -IMAPAccount gmail -Host imap.gmail.com -User dehaeze.thomas@gmail.com -PassCmd "pass email/dehaeze.thomas@gmail.com" -SSLType IMAPS -AuthMechs LOGIN -CertificateFile /etc/ssl/certs/ca-certificates.crt + IMAPAccount gmail + Host imap.gmail.com + User dehaeze.thomas@gmail.com + PassCmd "pass email/dehaeze.thomas@gmail.com" + SSLType IMAPS + AuthMechs LOGIN + CertificateFile /etc/ssl/certs/ca-certificates.crt #+END_SRC #+BEGIN_SRC conf -IMAPStore gmail-remote -Account gmail + IMAPStore gmail-remote + Account gmail -MaildirStore gmail-local -Path ~/.mail/gmail/ -Inbox ~/.mail/gmail/Inbox + MaildirStore gmail-local + Path ~/.mail/gmail/ + Inbox ~/.mail/gmail/Inbox -Channel gmail-Home -Master :gmail-remote:"INBOX" -Slave :gmail-local:Inbox + Channel gmail-Home + Master :gmail-remote:"INBOX" + Slave :gmail-local:Inbox -Channel gmail-Drafts -Master :gmail-remote:"[Gmail]/Drafts" -Slave :gmail-local:Drafts + Channel gmail-Drafts + Master :gmail-remote:"[Gmail]/Drafts" + Slave :gmail-local:Drafts -Channel gmail-Sent -Master :gmail-remote:"[Gmail]/Sent Mail" -Slave :gmail-local:Sent + Channel gmail-Sent + Master :gmail-remote:"[Gmail]/Sent Mail" + Slave :gmail-local:Sent -Channel gmail-Trash -Master :gmail-remote:"[Gmail]/Trash" -Slave :gmail-local:Trash + Channel gmail-Trash + Master :gmail-remote:"[Gmail]/Trash" + Slave :gmail-local:Trash -Channel gmail-All -Master :gmail-remote:"[Gmail]/All Mail" -Slave :gmail-local:Archive + Channel gmail-All + Master :gmail-remote:"[Gmail]/All Mail" + Slave :gmail-local:Archive #+END_SRC #+BEGIN_SRC conf -# Catch-all for everything else: note that the `Patterns` have to exclude both -# the remote and local names for all the folders we want to exclude (except -# "INBOX", which is special-cased, it would seem). -Channel gmail -Master :gmail-remote: -Slave :gmail-local: -# Exclude everything under the internal [Gmail] folder, except the interesting folders -Patterns * -Patterns !INBOX -Patterns ![Gmail]* -Patterns !Archive -Patterns !Drafts -Patterns !Sent Mail -Patterns !Trash -Patterns !Spam -Patterns !Starred + # Catch-all for everything else: note that the `Patterns` have to exclude both + # the remote and local names for all the folders we want to exclude (except + # "INBOX", which is special-cased, it would seem). + Channel gmail + Master :gmail-remote: + Slave :gmail-local: + # Exclude everything under the internal [Gmail] folder, except the interesting folders + Patterns * + Patterns !INBOX + Patterns ![Gmail]* + Patterns !Archive + Patterns !Drafts + Patterns !Sent Mail + Patterns !Trash + Patterns !Spam + Patterns !Starred #+END_SRC #+BEGIN_SRC conf -# For doing a quick sync of just the INBOX with `mbsync gmail-download`. -Channel gmail-download -Master :gmail-remote:"INBOX" -Slave :gmail-local:Inbox -Create Slave -Expunge Slave -Sync Pull + # For doing a quick sync of just the INBOX with `mbsync gmail-download`. + Channel gmail-download + Master :gmail-remote:"INBOX" + Slave :gmail-local:Inbox + Create Slave + Expunge Slave + Sync Pull #+END_SRC ** ESRF Account #+BEGIN_SRC conf -IMAPAccount esrf -Host imaps.esrf.fr -User dehaeze -PassCmd "pass email/thomas.dehaeze@esrf.fr" -SSLType IMAPS -AuthMechs LOGIN + IMAPAccount esrf + Host imaps.esrf.fr + User dehaeze + PassCmd "pass email/thomas.dehaeze@esrf.fr" + SSLType IMAPS + AuthMechs LOGIN #+END_SRC #+BEGIN_SRC conf -IMAPStore esrf-remote -Account esrf + IMAPStore esrf-remote + Account esrf -MaildirStore esrf-local -Path ~/.mail/esrf/ -Inbox ~/.mail/esrf/Inbox + MaildirStore esrf-local + Path ~/.mail/esrf/ + Inbox ~/.mail/esrf/Inbox -Channel esrf-Home -Master :esrf-remote:"Inbox" -Slave :esrf-local:Inbox + Channel esrf-Home + Master :esrf-remote:"Inbox" + Slave :esrf-local:Inbox -Channel esrf-Drafts -Master :esrf-remote:"Drafts" -Slave :esrf-local:Drafts + Channel esrf-Drafts + Master :esrf-remote:"Drafts" + Slave :esrf-local:Drafts -Channel esrf-Archive -Master :esrf-remote:"Archive" -Slave :esrf-local:Archive + Channel esrf-Archive + Master :esrf-remote:"Archive" + Slave :esrf-local:Archive -Channel esrf-Sent -Master :esrf-remote:"Sent" -Slave :esrf-local:Sent + Channel esrf-Sent + Master :esrf-remote:"Sent" + Slave :esrf-local:Sent -Channel esrf-Trash -Master :esrf-remote:"Trash" -Slave :esrf-local:Trash + Channel esrf-Trash + Master :esrf-remote:"Trash" + Slave :esrf-local:Trash #+END_SRC #+BEGIN_SRC conf -Channel esrf -Master :esrf-remote: -Slave :esrf-local: + Channel esrf + Master :esrf-remote: + Slave :esrf-local: #+END_SRC For doing a quick sync of just the INBOX with `mbsync esrf-download`. #+BEGIN_SRC conf -Channel esrf-download -Master :esrf-remote:"INBOX" -Slave :esrf-local:Inbox -Create Slave -Expunge Slave -Sync Pull + Channel esrf-download + Master :esrf-remote:"INBOX" + Slave :esrf-local:Inbox + Create Slave + Expunge Slave + Sync Pull #+END_SRC ** ULG Student Account #+BEGIN_SRC conf -IMAPAccount ulg -Host mail.ulg.ac.be -User thomas.dehaeze@doct.uliege.be -PassCmd "pass email/thomas.dehaeze@doct.uliege.be" -SSLType IMAPS -AuthMechs LOGIN + IMAPAccount ulg + Host mail.ulg.ac.be + User thomas.dehaeze@doct.uliege.be + PassCmd "pass email/thomas.dehaeze@doct.uliege.be" + SSLType IMAPS + AuthMechs LOGIN #+END_SRC #+BEGIN_SRC conf -IMAPStore ulg-remote -Account ulg + IMAPStore ulg-remote + Account ulg -MaildirStore ulg-local -Path ~/.mail/ulg/ -Inbox ~/.mail/ulg/Inbox + MaildirStore ulg-local + Path ~/.mail/ulg/ + Inbox ~/.mail/ulg/Inbox -Channel ulg-Home -Master :ulg-remote:"Inbox" -Slave :ulg-local:Inbox + Channel ulg-Home + Master :ulg-remote:"Inbox" + Slave :ulg-local:Inbox -Channel ulg-Drafts -Master :ulg-remote:"Drafts" -Slave :ulg-local:Drafts + Channel ulg-Drafts + Master :ulg-remote:"Drafts" + Slave :ulg-local:Drafts -Channel ulg-Archive -Master :ulg-remote:"Archive" -Slave :ulg-local:Archive + Channel ulg-Archive + Master :ulg-remote:"Archive" + Slave :ulg-local:Archive -Channel ulg-Sent -Master :ulg-remote:"Sent" -Slave :ulg-local:Sent + Channel ulg-Sent + Master :ulg-remote:"Sent" + Slave :ulg-local:Sent -Channel ulg-Trash -Master :ulg-remote:"Trash" -Slave :ulg-local:Trash + Channel ulg-Trash + Master :ulg-remote:"Trash" + Slave :ulg-local:Trash #+END_SRC #+BEGIN_SRC conf -Channel ulg -Master :ulg-remote: -Slave :ulg-local: + Channel ulg + Master :ulg-remote: + Slave :ulg-local: #+END_SRC For doing a quick sync of just the INBOX with `mbsync ulg-download`. #+BEGIN_SRC conf -Channel ulg-download -Master :ulg-remote:"Inbox" -Slave :ulg-local:Inbox -Create Slave -Expunge Slave -Sync Pull + Channel ulg-download + Master :ulg-remote:"Inbox" + Slave :ulg-local:Inbox + Create Slave + Expunge Slave + Sync Pull #+END_SRC ** ULG Personal Account #+BEGIN_SRC conf -IMAPAccount uliege -Host mail.ulg.ac.be -User tdehaeze@uliege.be -PassCmd "pass email/tdehaeze@uliege.be" -SSLType IMAPS -AuthMechs LOGIN + IMAPAccount uliege + Host mail.ulg.ac.be + User tdehaeze@uliege.be + PassCmd "pass email/tdehaeze@uliege.be" + SSLType IMAPS + AuthMechs LOGIN #+END_SRC #+BEGIN_SRC conf -IMAPStore uliege-remote -Account uliege + IMAPStore uliege-remote + Account uliege -MaildirStore uliege-local -Path ~/.mail/uliege/ -Inbox ~/.mail/uliege/Inbox + MaildirStore uliege-local + Path ~/.mail/uliege/ + Inbox ~/.mail/uliege/Inbox -Channel uliege-Home -Master :uliege-remote:"Inbox" -Slave :uliege-local:Inbox + Channel uliege-Home + Master :uliege-remote:"Inbox" + Slave :uliege-local:Inbox -Channel uliege-Drafts -Master :uliege-remote:"Drafts" -Slave :uliege-local:Drafts + Channel uliege-Drafts + Master :uliege-remote:"Drafts" + Slave :uliege-local:Drafts -Channel uliege-Archive -Master :uliege-remote:"Archive" -Slave :uliege-local:Archive + Channel uliege-Archive + Master :uliege-remote:"Archive" + Slave :uliege-local:Archive -Channel uliege-Sent -Master :uliege-remote:"Sent" -Slave :uliege-local:Sent + Channel uliege-Sent + Master :uliege-remote:"Sent" + Slave :uliege-local:Sent -Channel uliege-Trash -Master :uliege-remote:"Trash" -Slave :uliege-local:Trash + Channel uliege-Trash + Master :uliege-remote:"Trash" + Slave :uliege-local:Trash #+END_SRC #+BEGIN_SRC conf -Channel uliege -Master :uliege-remote: -Slave :uliege-local: + Channel uliege + Master :uliege-remote: + Slave :uliege-local: #+END_SRC For doing a quick sync of just the INBOX with `mbsync uliege-download`. #+BEGIN_SRC conf -Channel uliege-download -Master :uliege-remote:"Inbox" -Slave :uliege-local:Inbox -Create Slave -Expunge Slave -Sync Pull + Channel uliege-download + Master :uliege-remote:"Inbox" + Slave :uliege-local:Inbox + Create Slave + Expunge Slave + Sync Pull #+END_SRC * Send Mails - Msmtp @@ -871,12 +871,12 @@ https://www.donarmstrong.com/posts/org_mode_mutt_capture/ https://upsilon.cc/~zack/blog/posts/2010/02/integrating_Mutt_with_Org-mode/ #+begin_src conf - macro index,pager S "$HOME/scripts/mutt-save-org-link.py\n" + macro index,pager S "$HOME/.config/neomutt/bin/mutt-save-org-link.py\n" #+end_src **** Link mail to orgmode - Script :PROPERTIES: -:header-args: :tangle ~/scripts/mutt-save-org-link.py +:header-args: :tangle ~/.config/neomutt/bin/mutt-save-org-link.py :header-args+: :comments both :mkdirp yes :header-args+: :shebang "#!/usr/bin/env python3" :END: @@ -1399,9 +1399,9 @@ Of ranger can be used with the =A= keybinding. #+begin_src bash if [ $TMUX ]; then - tmux split -v -l 1 ~/scripts/checkmail.sh $1 && tmux select-pane -U + tmux split -v -l 1 checkmail $1 && tmux select-pane -U else - ~/scripts/checkmail.sh $1 + checkmail $1 fi #+end_src diff --git a/dotfiles/newsboat.org b/dotfiles/newsboat.org index a72136e..6e8f69a 100644 --- a/dotfiles/newsboat.org +++ b/dotfiles/newsboat.org @@ -146,28 +146,28 @@ https://newsboat.org/releases/2.12/docs/newsboat.html ** Macros - Starts with , key #+BEGIN_SRC conf # Default Browser - browser "qutebrowser %u" + browser linkhandler # Open in Browser macro , open-in-browser # Download Video with Youtube-DL - macro t set browser "~/bin/yt-video %u" ; open-in-browser ; set browser "qutebrowser %u" + macro t set browser "~/.local/bin/yt-video %u" ; open-in-browser ; set browser linkhandler # Download Audio with Youtube-DL - macro a set browser "~/bin/yt-audio %u" ; open-in-browser ; set browser "qutebrowser %u" + macro a set browser "~/.local/bin/yt-audio %u" ; open-in-browser ; set browser linkhandler # Open Video with MPV - macro v set browser "setsid nohup mpv %u &> /dev/null &" ; open-in-browser ; set browser "qutebrowser %u" + macro v set browser "setsid nohup mpv %u &> /dev/null &" ; open-in-browser ; set browser linkhandler # Open With W3M - macro w set browser "w3m %u" ; open-in-browser ; set browser "qutebrowser %u" + macro w set browser "w3m %u" ; open-in-browser ; set browser linkhandler # Copy Address to clipboard - macro c set browser "xsel -b <<<" ; open-in-browser ; set browser "qutebrowser %u" + macro c set browser "xsel -b <<<" ; open-in-browser ; set browser linkhandler # Quit - macro q set browser "tmux detach;" ; open-in-browser ; set browser "qutebrowser %u" + macro q set browser "tmux detach;" ; open-in-browser ; set browser linkhandler #+END_SRC ** hide articles matching @@ -286,6 +286,7 @@ https://newsboat.org/releases/2.12/docs/newsboat.html http://howardism.org/index.xml "~RSS Howardism" emacs http://xkcd.com/rss.xml "~RSS XKCD" random https://quantasylum.com/blogs/news.atom "~RSS QuantAsylum" audio + https://blog.jethro.dev/index.xml "~RSS Jethro Kuan" emacs #+end_src ** Youtube diff --git a/dotfiles/polybar.org b/dotfiles/polybar.org index 8360569..fa4cbbe 100644 --- a/dotfiles/polybar.org +++ b/dotfiles/polybar.org @@ -386,7 +386,7 @@ :END: #+begin_src bash dunstify --replace=98465 "Mails " "Syncing..."; - ~/scripts/checkmail.sh -q && \ + checkmail -q && \ mail_nb=`du -a ~/.mail/*/Inbox/new/* 2>/dev/null | wc -l` && \ if [ "$mail_nb" -eq "0" ]; then dunstify --replace=98465 "Mails " "No new mail"; @@ -546,7 +546,7 @@ dunstify --replace=23198 "VPN" "Disconnected" && \ echo "off" > $tmpfile; else - country=`cat ~/bin/nordvpn_countries.txt | sed 's/\s*\t\s*/ /g ; s/\s/\n/g ; s/_/ /g ; /^[a-zA-Z]/!d ; s/\(.*\)/\L\1/' | rofi -i -dmenu | sed 's/\s/_/g'`; + country=`cat ~/.local/data/nordvpn_countries.txt | sed 's/\s*\t\s*/ /g ; s/\s/\n/g ; s/_/ /g ; /^[a-zA-Z]/!d ; s/\(.*\)/\L\1/' | rofi -i -dmenu | sed 's/\s/_/g'`; dunstify --replace=23198 "VPN" "Connecting to $country..."; nordvpn connect $country && \ dunstify --replace=23198 "VPN" "Connected to $country" && \ @@ -675,7 +675,7 @@ format-underline = ${colors.bg} click-left = ~/.config/polybar/scripts/lockscreen-toggle.sh - click-right = ~/scripts/lockscreen.sh + click-right = ~/.local/bin/lockscreen format =