gnupg, aria2: add configs

This commit is contained in:
Hoang Nguyen 2021-02-23 05:30:23 +03:00
parent cf7f6698b1
commit b04d6cf740
No known key found for this signature in database
GPG Key ID: 813CF484F4993419
9 changed files with 175 additions and 41 deletions

View File

@ -20,9 +20,9 @@
- Run `deploy.sh` to deploy the dotfiles.
- `setup/` directory contains installers for additional packages.
- Stuff I use:
- **Text editor:** [Emacs](http://www.gnu.org/software/emacs/) + [Neovim](https://github.com/neovim/neovim) (why arguing when you can use both)
- **Text editor:** [Emacs](http://www.gnu.org/software/emacs/) + [Neovim](https://github.com/neovim/neovim)
- **Fonts:** [Sarasa Gothic](https://github.com/be5invis/Sarasa-Gothic), [Iosevka Nerd Font](https://github.com/ryanoasis/nerd-fonts)
- **Info for the status bar:** jq, sysstat, psmisc, wireless_tools
- **Info for the status bar:** [jq](https://github.com/stedolan/jq), sysstat, psmisc, wireless_tools
- **Backlight control:** [light](https://github.com/haikarainen/light) / [brightnessctl](https://github.com/Hummer12007/brightnessctl)
- **Clipboard manager:** [greenclip](https://github.com/erebe/greenclip) / [clipman](https://github.com/yory8/clipman)
- **Mixer:** [pulsemixer](https://github.com/GeorgeFilipkin/pulsemixer)
@ -40,8 +40,10 @@
- **Shell:** [fish](https://github.com/fish-shell/fish-shell)
- **Shell prompt:** [starship](https://starship.rs/)
- **Anime/Manga/Wallpaper:** [gallery-dl](https://github.com/mikf/gallery-dl) / [mangadl-bash](https://github.com/Akianonymus/mangadl-bash), [anime-downloader](https://github.com/anime-dl/anime-downloader) + [trackma](https://github.com/z411/trackma) + [adl](https://github.com/RaitaroH/adl) / [anigrab](https://github.com/ngomile/anigrab)
- **CLI/TUI tools for the Internet:** [translate-shell](https://github.com/soimort/translate-shell), [ddgr](https://github.com/jarun/ddgr), [howdoi](https://github.com/gleitz/howdoi), [tuxi](https://github.com/Bugswriter/tuxi), [amfora](https://github.com/makeworld-the-better-one/amfora), [cointop](https://github.com/miguelmota/cointop), [newsboat](https://github.com/newsboat/newsboat), [youtube-dl](https://github.com/ytdl-org/youtube-dl) + [ytmdl](https://github.com/deepjyoti30/ytmdl), [github-cli](https://github.com/cli/cli), [pup](https://github.com/ericchiang/pup), [tmpsms](https://github.com/sdushantha/tmpsms), [tmpmail](https://github.com/sdushantha/tmpmail), [weechat](https://github.com/weechat/weechat), [curl](https://curl.haxx.se) / [wget](https://www.gnu.org/software/wget/wget.html), [tremc](https://github.com/tremc/tremc) + [transmission](https://github.com/transmission/transmission) / [rtorrent](https://github.com/rakshasa/rtorrent)
- **CLI/TUI tools for other things:** [farge](https://github.com/sdushantha/farge), [tt](https://github.com/runrin/tt), [forgit](https://github.com/wfxr/forgit), [borg](https://github.com/borgbackup/borg), [wendy](https://git.z3bra.org/wendy/log.html), [tokei](https://github.com/XAMPPRocky/tokei), [onefetch](https://github.com/o2sh/onefetch), [calcurse](https://github.com/lfos/calcurse), [qalculate](https://github.com/Qalculate/libqalculate), [fzf](https://github.com/junegunn/fzf), [fd](https://github.com/sharkdp/fd), [ripgrep](https://github.com/BurntSushi/ripgrep), [atool](http://www.nongnu.org/atool/), [rsync](https://rsync.samba.org/), [bottom](https://github.com/clementtsang/bottom), [hyperfine](https://github.com/sharkdp/hyperfine), [delta](https://github.com/dandavison/delta), [bat](https://github.com/sharkdp/bat), [glow](https://github.com/charmbracelet/glow) / [mdcat](https://github.com/lunaryorn/mdcat) / [mdr](https://github.com/MichaelMure/mdr), [exa](https://github.com/ogham/exa), pandoc, tree, [csview](https://github.com/wfxr/csview), [libsixel](https://github.com/saitoha/libsixel), [buku](https://github.com/jarun/buku)
- **CLI/TUI tools for the Internet:** [translate-shell](https://github.com/soimort/translate-shell), [ddgr](https://github.com/jarun/ddgr), [howdoi](https://github.com/gleitz/howdoi), [tuxi](https://github.com/Bugswriter/tuxi), [amfora](https://github.com/makeworld-the-better-one/amfora), [cointop](https://github.com/miguelmota/cointop), [newsboat](https://github.com/newsboat/newsboat), [youtube-dl](https://github.com/ytdl-org/youtube-dl) + [ytmdl](https://github.com/deepjyoti30/ytmdl), [github-cli](https://github.com/cli/cli), [pup](https://github.com/ericchiang/pup), [tmpsms](https://github.com/sdushantha/tmpsms), [tmpmail](https://github.com/sdushantha/tmpmail), [weechat](https://github.com/weechat/weechat), [curl](https://curl.haxx.se) / [wget](https://www.gnu.org/software/wget/wget.html) / [aria2](https://github.com/aria2/aria2), [tremc](https://github.com/tremc/tremc) + [transmission](https://github.com/transmission/transmission) / [rtorrent](https://github.com/rakshasa/rtorrent)
- **CLI/TUI tools for other things:** [farge](https://github.com/sdushantha/farge), [tt](https://github.com/runrin/tt), [forgit](https://github.com/wfxr/forgit), [borg](https://github.com/borgbackup/borg), [wendy](https://git.z3bra.org/wendy/log.html), [tokei](https://github.com/XAMPPRocky/tokei), [onefetch](https://github.com/o2sh/onefetch), [calcurse](https://github.com/lfos/calcurse), [qalculate](https://github.com/Qalculate/libqalculate), [fzf](https://github.com/junegunn/fzf), [fd](https://github.com/sharkdp/fd), [ripgrep](https://github.com/BurntSushi/ripgrep), [atool](http://www.nongnu.org/atool/), [rsync](https://rsync.samba.org/), [bottom](https://github.com/clementtsang/bottom), [hyperfine](https://github.com/sharkdp/hyperfine), [delta](https://github.com/dandavison/delta), [bat](https://github.com/sharkdp/bat), [glow](https://github.com/charmbracelet/glow) / [mdcat](https://github.com/lunaryorn/mdcat) / [mdr](https://github.com/MichaelMure/mdr), [exa](https://github.com/ogham/exa), [pandoc](https://github.com/jgm/pandoc), tree, [csview](https://github.com/wfxr/csview), [libsixel](https://github.com/saitoha/libsixel), [buku](https://github.com/jarun/buku)
> `Emacs` deserves its own set of dependencies, but whatever
> zsh requires adding `export ZDOTDIR=$HOME/.config/zsh` to **/etc/zsh/zshenv**

View File

@ -84,6 +84,7 @@ cp -rfv ./home/.local/bin/ ~/.local/bin/
cp -rfv ./home/.config/alacritty/ ~/.config/alacritty/
cp -rfv ./home/.config/amfora/ ~/.config/amfora/
cp -rfv ./home/.config/anime-downloader/ ~/.config/anime-downloader/
cp -rfv ./home/.config/aria2/ ~/.config/aria2/
cp -rfv ./home/.config/bottom/ ~/.config/bottom/
cp -rfv ./home/.config/cava/ ~/.config/cava/
cp -rfv ./home/.config/cointop/ ~/.config/cointop/
@ -111,6 +112,8 @@ cp -rfv ./home/.config/zathura/ ~/.config/zathura/
cp -rfv ./home/.config/mimeapps.list ~/.config/mimeapps.list
cp -rfv ./home/.config/pulsemixer.cfg ~/.config/pulsemixer.cfg
cp -rfv ./home/.config/starship.toml ~/.config/starship.toml
# gpg
cp -rfv ./home/.local/share/gnupg/ ~/.local/share/gnupg/
echo "
~~~ Cloning submodules ~~~
@ -119,17 +122,20 @@ echo "
[ -d ~/.config/tmux/plugins/tpm ] || git clone https://github.com/tmux-plugins/tpm ~/.config/tmux/plugins/tpm
[ -d ~/.config/ranger/plugins/ranger_devicons ] || git clone https://github.com/FollieHiyuki/ranger_devicons ~/.config/ranger/plugins/ranger_devicons
# Post deployment
echo "
~~~ Post deployment ~~~
"
# Needed data dirs
mkdir -pv ~/.local/share/bash
mkdir -pv ~/.local/share/mpd/playlists
mkdir -pv ~/.local/share/gallery-dl
# tridactyl needs `tridactylrc` to exist
# tridactyl needs `tridactylrc` to work
touch ~/.config/tridactyl/tridactylrc
mkdir -pv ~/.local/share/gnupg
# gpg directory needs strict permissions
chmod -v 700 ~/.local/share/gnupg
cp -rfv ./home/.local/share/gnupg/gpg-agent.conf ~/.local/share/gnupg/
chmod -v 600 ~/.local/share/gnupg/*
# Just to be safe
chmod -v 600 ~/.config/aria2/aria2.conf
# chsh -s /usr/bin/${shell} ${USER}

View File

@ -0,0 +1,63 @@
# ----- Basic stuff ----- #
# Default download directory
dir=${HOME}/Downloads/aria2
# We have ext4 / btrfs so it's safe
file-allocation=falloc
# Who doesn't like fancy output
enable-color=true
# Resume download, or restart if the control file doesn't exist
continue=true
always-resume=true
allow-overwrite=true
# Suppress progress output
summary-interval=0
# More logging
log-level=warn
# Faster download?
min-split-size=5M
max-connection-per-server=4
# No IPv6
#disable-ipv6=true
# ----- BitTorrent stuff ----- #
# Don't save *.torrent files on disk
#follow-torrent=mem
# We are friendly and useful
seed-ratio=2.0
seed-time=60
# Save bandwidth
max-upload-limit=256K
max-overall-upload-limit=1M
# ----- HTTP stuff ----- #
# Send "deflate, gzip" header
http-accept-gzip=true
# Send http auth header only when needed
http-auth-challenge=true
# ----- Metalink stuff ----- #
# Again don't save stuff on disk
#follow-metalink=mem
# Preferred server locations
metalink-location=de,us,jp,ru,fr
# Preferred protocol
metalink-preferred-protocol=https
# ----- FTP/SFTP stuff ----- #
# Passive mode (doesn't work with sftp)
ftp-pasv=true
# Reuse connection
ftp-reuse-connection=true

View File

@ -111,10 +111,6 @@
(after! flyspell
(setq flyspell-lazy-idle-seconds 2))
;; Elfeed
(setq rmh-elfeed-org-files (list (expand-file-name "elfeed.org" doom-private-dir)))
;;(add-hook! 'elfeed-search-mode-hook 'elfeed-update)
;; Asynchronous bytecode compilation
(use-package! async
:defer t
@ -131,14 +127,6 @@
(after! magit
(setq magit-diff-refine-hunk 'all))
;; Edit buffer as sudo
;;(defun follie/sudo-edit (&optional arg)
;; "Edit file as super-user with optional ARG."
;; (interactive "P")
;; (if (or arg (not buffer-file-name))
;; (find-file (concat "/sudo::" (read-file-name "File (as root): ")))
;; (find-alternate-file (concat "/sudo::" buffer-file-name))))
;; Here are some additional functions/macros that could help you configure Doom:
;;
;; - `load!' for loading external *.el files relative to this one

View File

@ -162,6 +162,10 @@
;; :config
;; (setq system-packages-use-sudo t))
;; Elfeed
(setq rmh-elfeed-org-files (list (expand-file-name "elfeed.org" doom-private-dir)))
;;(add-hook! 'elfeed-search-mode-hook 'elfeed-update)
;; EMMS
;;(use-package! emms
;; :init
@ -211,6 +215,21 @@
;; (emms-playing-time 1)
;; (emms-mode-line 1)
;; (emms-mode-line-cycle 1))
;;(use-package! ivy-emms
;; :after emms
;; :config
;; (setq ivy-emms-default-action #'ivy-emms-play-next)
;; (setq ivy-emms-default-multi-action #'ivy-emms-play-next-multi))
;; Duck the web with ivy
(use-package! counsel-web
:after counsel
:config
(setq counsel-web-engine 'duckduckgo)
(setq counsel-web-search-action #'browse-url)
(setq counsel-web-search-alternate-action #'browse-url-firefox)
(setq counsel-web-search-dynamic-update nil)
(exwm-input-set-key (kbd "s-s") #'counsel-web-search))
;; Function keys
(use-package! desktop-environment
@ -252,28 +271,27 @@
(desktop-environment-screenlock-command "~/.local/bin/X11/i3lock.sh"))
;; Control dunst
(defun follie/disable-desktop-notifications ()
(defun disable-desktop-notifications ()
(interactive)
(start-process-shell-command "notify-send" nil "notify-send \"DUNST_COMMAND_PAUSE\""))
(defun follie/enable-desktop-notifications ()
(defun enable-desktop-notifications ()
(interactive)
(start-process-shell-command "notify-send" nil "notify-send \"DUNST_COMMAND_RESUME\""))
(defun follie/toggle-desktop-notifications ()
(defun toggle-desktop-notifications ()
(interactive)
(start-process-shell-command "notify-send" nil "notify-send \"DUNST_COMMAND_TOGGLE\""))
;; DuckDuckGo
(defun ddgr ()
"Duck the web inside Emacs with `ddgr'"
;; Clipboard managing with greenclip
(defun ivy-greenclip ()
"Select an item from clipboard history and re-copy it"
(interactive)
(let* ((query (read-from-minibuffer "Search query: "))
(results (shell-command-to-string (concat "ddgr -x --np --noua -C " query)))
(buffer "*DuckDuckGo*"))
(when (get-buffer buffer)
(kill-buffer buffer))
(with-current-buffer (generate-new-buffer buffer)
(insert "** Search results:\n\n")
(insert results))
(switch-to-buffer buffer)
(org-mode)
(evil-goto-first-line)))
(let* ((history (split-string (shell-command-to-string "greenclip print") "[\r\n]+")))
(ivy-read "Copy item from entry: "
history
:action (lambda (item)
;; Kind of work, though fish-shell is not happy
(shell-command (concat "greenclip print '" item "'"))))))
(defun greenclip-clean ()
"Clean clipboard history cache"
(interactive)
(start-process-shell-command "greenclip" nil "pkill greenclip && greenclip clear && greenclip daemon"))

View File

@ -180,7 +180,8 @@
+lsp
+pyenv
+poetry
+pyright)
+pyright
+cpython)
;;qt ; the 'cutest' gui framework ever
;;racket ; a DSL for DSLs
;;raku ; the artist formerly known as perl6

View File

@ -52,16 +52,18 @@
;; Emacs is an OS
(package! exwm)
(package! exwm-edit)
;;(package! system-packages)
(package! desktop-environment)
(package! ebuku)
(package! counsel-web)
;;(package! system-packages)
;;(package! emms)
;;(package! emms-mode-line-cycle)
;;(package! ivy-emms)
;;(package! org-roam)
;; Syntax
(package! vimrc-mode)
;; Improvements
(package! async)
(package! magit-delta)
;; (package! mixed-pitch)

View File

@ -1,6 +1,15 @@
# https://www.gnupg.org/documentation/manuals/gnupg/Agent-Options.html
# gpg-agent timeout
max-cache-ttl 14400
default-cache-ttl 7200
max-cache-ttl-ssh 14400
default-cache-ttl-ssh 7200
# Replace ssh-agent as well
enable-ssh-support
# the default password prompt
allow-emacs-pinentry
pinentry-program /usr/bin/pinentry-curses
#pinentry-program /usr/bin/pinentry-gnome3

View File

@ -0,0 +1,45 @@
# https://www.gnupg.org/documentation/manuals/gnupg/GPG-Configuration-Options.html
# https://www.gnupg.org/documentation/manuals/gnupg/GPG-Esoteric-Options.html
# No greeting
no-greeting
# No version in output
no-emit-version
# Keyservers
keyserver hkp://keys.gnupg.net
# The command line that should be run to view a photo ID
photo-viewer "display %i"
# Use the following options when verifying signatures
verify-options show-photos show-user-notations pka-lookup
list-options show-usage show-user-notations show-uid-validity
# Disable caching of passphrase for symmetrical ops
no-symkey-cache
# Display all keys and their fingerprints
with-fingerprint
# Long hexidecimal key format
#keyid-format 0xlong
# The message digest algorithm used when signing a key
cert-digest-algo SHA512
# The default key to sign with
default-key 9FB01E38DDD7E1459A4C3DAC813CF484F4993419
# Use the default key as default recipient
default-recipient-self
# Personal algorithms
personal-cipher-preferences AES256 AES192 AES CAST5
personal-digest-preferences SHA256 SHA512 SHA384 SHA224
personal-compress-preferences ZLIB BZIP2 ZIP Uncompressed
# No one seems to use these
disable-cipher-algo 3DES
disable-cipher-algo BLOWFISH