Compare commits

..
11 Commits
18 changed files with 366 additions and 29 deletions
+2 -1
View File
@@ -35,7 +35,7 @@ bspc config pointer_modifier mod4
bspc config external_rules_command "$HOME/.config/bspwm/rules"
# Reset all rules
bspc rule -r *
bspc rule -r \*
# Open program on specific desktop
bspc rule -a firefox desktop="$WS1" locked=on
@@ -48,6 +48,7 @@ bspc rule -a krita desktop="$WS5" follow=on
bspc rule -a Arandr state=floating
bspc rule -a Emacs state=tiled
bspc rule -a feh state=floating
bspc rule -a firefox:Browser state=floating
bspc rule -a firefox:Places state=floating
bspc rule -a Inferno state=floating
bspc rule -a Lxappearance state=floating
+167 -4
View File
@@ -37,6 +37,7 @@
- [[#programming-integration][Programming Integration]]
- [[#lsp][LSP]]
- [[#dap][DAP]]
- [[#web-mode][Web Mode]]
- [[#programming-languages][Programming Languages]]
- [[#cc][C/C++]]
- [[#lua][Lua]]
@@ -44,8 +45,10 @@
- [[#cmake][CMake]]
- [[#glsl][GLSL]]
- [[#yaml][YAML]]
- [[#kotlin][Kotlin]]
- [[#rss][RSS]]
- [[#git][Git]]
- [[#mail][Mail]]
- [[#prettify][Prettify]]
- [[#general][General]]
- [[#buffers][Buffers]]
@@ -363,6 +366,7 @@ Places buffers as tabs in a bar at the top.
((eshell-mode
help-mode
helpful-mode
mu4e-view-mode
neotree-mode
org-roam-backlinks-mode
shell-mode)
@@ -623,7 +627,9 @@ Language Server Protocol.
c++-mode ; clangd
lua-mode ; lua-language-server
php-mode ; nodejs-intelephense
latex-mode) ; texlab
latex-mode ; texlab
kotlin-mode ; kotlin-language-server
web-mode)
. lsp-deferred)
:config
(setq lsp-auto-guess-root t)
@@ -692,10 +698,24 @@ Debug Adapter Protocol.
(make-directory dap-utils-extension-path t)))
#+END_SRC
**** Web Mode
#+BEGIN_SRC emacs-lisp
(use-package web-mode
:defer t)
#+END_SRC
*** Programming Languages
**** C/C++
#+BEGIN_SRC emacs-lisp
(use-package c++-mode
:ensure nil
:defer t
:hook
(c++-mode . (lambda ()
(setq lsp-ui-doc-enable t))))
(use-package company-c-headers
:after company
:config (push 'company-c-headers company-backends))
@@ -751,6 +771,13 @@ Debug Adapter Protocol.
:defer t)
#+END_SRC
**** Kotlin
#+BEGIN_SRC emacs-lisp
(use-package kotlin-mode
:defer t)
#+END_SRC
*** RSS
#+BEGIN_SRC emacs-lisp
@@ -799,6 +826,117 @@ Debug Adapter Protocol.
(put 'magit-log-select-quit :advertised-binding [?\M-k]))
#+END_SRC
*** Mail
#+BEGIN_SRC emacs-lisp
(use-package mu4e
:ensure nil
:load-path "/usr/share/emacs/site-lisp/mu4e"
:defer 5
:config
(setq auth-sources `(,(concat dot-etc-dir "/authinfo.gpg")))
(setq user-full-name (dot/mail-auth-get-field "fullname" :user))
(setq user-mail-address (dot/mail-auth-get-field "info" :user))
(setq mail-user-agent 'mu4e-user-agent)
;; Headers
(setq mu4e-headers-date-format "%d-%m-%Y")
(setq mu4e-headers-time-format "%I:%M %p")
(setq mu4e-headers-long-date-format "%d-%m-%Y %I:%M:%S %p")
;; Syncing
(setq mu4e-get-mail-command (concat "mbsync -a -c " (getenv "XDG_CONFIG_HOME") "/isync/mbsyncrc"))
(setq mu4e-update-interval (* 15 60)) ; 15 minutes
(setq mu4e-maildir "~/mail")
(setq mu4e-attachment-dir "~/downloads")
;; Avoid mail syncing issues when using mbsync
(setq mu4e-change-filenames-when-moving t)
;; Misc
(setq mu4e-completing-read-function 'completing-read)
(setq mu4e-confirm-quit nil)
(setq mu4e-display-update-status-in-modeline t)
(setq mu4e-hide-index-messages t)
(setq mu4e-sent-messages-behavior 'sent)
(setq mu4e-view-show-addresses t)
(setq mu4e-view-show-images nil)
;; Compose
(setq mu4e-compose-context-policy 'ask)
(setq mu4e-compose-dont-reply-to-self t)
(setq mu4e-compose-signature (concat (dot/mail-auth-get-field "fullname" :user) "\nriyyi.com\n"))
(setq mu4e-compose-signature-auto-include t)
;; Contexts
(setq mu4e-context-policy 'pick-first)
(setq mu4e-contexts
`(,(make-mu4e-context
:name "info"
:match-func (lambda (msg)
(when msg
(string= (mu4e-message-field msg :maildir) "/info")))
:vars `((user-mail-address . ,(dot/mail-auth-get-field "info" :user))
(mu4e-drafts-folder . "/info/Drafts")
(mu4e-refile-folder . "/info/Archive")
(mu4e-sent-folder . "/info/Sent")
(mu4e-trash-folder . "/info/Trash")))
,(make-mu4e-context
:name "private"
:match-func (lambda (msg)
(when msg
(string= (mu4e-message-field msg :maildir) "/private")))
:vars `((user-mail-address . ,(dot/mail-auth-get-field "private" :user))
(mu4e-drafts-folder . "/private/Drafts")
(mu4e-refile-folder . "/private/Archive")
(mu4e-sent-folder . "/private/Sent")
(mu4e-trash-folder . "/private/Trash")))
))
;; Do not mark messages as IMAP-deleted, just move them to the Trash directory!
;; https://github.com/djcb/mu/issues/1136#issuecomment-486177435
(setf (alist-get 'trash mu4e-marks)
(list :char '("d" . "")
:prompt "dtrash"
:dyn-target (lambda (target msg)
(mu4e-get-trash-folder msg))
:action (lambda (docid msg target)
(mu4e~proc-move docid (mu4e~mark-check-target target) "-N"))))
;; Start mu4e in the background for mail syncing
(mu4e t))
(use-package mu4e-alert
:after mu4e
:config
(mu4e-alert-set-default-style 'libnotify)
(mu4e-alert-enable-notifications))
(use-package smtpmail ; built-in
:init (setq smtpmail-default-smtp-server "mail.riyyi.com")
:config
(setq smtpmail-smtp-server "mail.riyyi.com")
(setq smtpmail-local-domain "riyyi.com")
(setq smtpmail-smtp-service 587)
(setq smtpmail-stream-type 'starttls)
(setq smtpmail-queue-mail nil))
(use-package sendmail ; built-in
:config (setq send-mail-function 'smtpmail-send-it))
(use-package message ; built-in
:config
(setq message-kill-buffer-on-exit t)
(setq message-send-mail-function 'smtpmail-send-it))
#+END_SRC
Sources:
- https://rakhim.org/fastmail-setup-with-emacs-mu4e-and-mbsync-on-macos/
- https://wiki.archlinux.org/title/Isync
- https://gitlab.com/protesilaos/dotfiles/-/blob/master/mbsync/.mbsyncrc
- https://gitlab.com/protesilaos/dotfiles/-/blob/master/emacs/.emacs.d/prot-lisp/prot-mail.el
- https://gitlab.com/protesilaos/dotfiles/-/blob/master/emacs/.emacs.d/prot-lisp/prot-mu4e-deprecated-conf.el
*** Prettify
#+BEGIN_SRC emacs-lisp
@@ -1215,6 +1353,13 @@ Functions that only use built-in Emacs functionality.
(save-excursion (insert (make-string diff ?\ )))
(user-error "Column should be higher than point")))))
(defun dot/mail-auth-get-field (host prop)
"Find PROP in `auth-sources' for HOST entry."
(when-let ((source (auth-source-search :max 1 :host host)))
(if (eq prop :secret)
(funcall (plist-get (car source) prop))
(plist-get (flatten-list source) prop))))
(defun dot/reload-theme ()
"Reload custom theme."
(interactive)
@@ -1629,7 +1774,18 @@ Evil command aliases.
(add-hook 'c-mode-hook (lambda () (c-toggle-comment-style 0)))
;; LaTeX, set correct tab mode
(add-hook 'latex-mode-hook (lambda () (setq indent-tabs-mode t)))
(add-hook 'latex-mode-hook (lambda ()
(setq indent-tabs-mode t)
(setq tab-width 4)))
(add-hook 'LaTeX-mode-hook (lambda ()
(setq indent-tabs-mode t)
(setq tab-width 4)))
;; Python
(add-hook 'python-mode-hook (lambda ()
(setq indent-tabs-mode t)
(setq python-indent-offset 4)
(setq tab-width 4)))
;; Disable line numbers
(add-hook 'Custom-mode-hook 'dot/hook-disable-line-numbers)
@@ -1885,6 +2041,13 @@ Set keybinds to functionality of installed packages.
"<down>" #'selectrum-next-candidate
)
;; Mu4e
(general-def 'normal mu4e-compose-mode-map
"q" #'mu4e-message-kill-buffer
"M-c" #'message-send-and-exit
"M-k" #'mu4e-message-kill-buffer
)
;; Neotree
(general-def 'normal neotree-mode-map
"RET" 'neotree-enter
@@ -2156,8 +2319,8 @@ https://github.com/suyashbire1/emacs.d/blob/master/init.el
"s" '(:ignore t :which-key "tree/subtree")
"s h" '(org-promote-subtree :which-key "Org promote subtree")
"s j" '(org-move-subree-down :which-key "Org move subtree down")
"s k" '(org-move-subtree-up :which-key "Org move subtree up")
"s j" '(org-metadown :which-key "Org move subtree down")
"s k" '(org-metaup :which-key "Org move subtree up")
"s l" '(org-demote-subtree :which-key "Org demote subtree")
"s <left>" '(org-promote-subtree :which-key "Org promote subtree")
"s <right>" '(org-demote-subtree :which-key "Org demote subtree")
+2
View File
@@ -7,6 +7,8 @@
;;; Code:
;; (setq debug-on-error t)
;; Defer the garbage collection during startup
(setq gc-cons-threshold most-positive-fixnum)
(add-hook 'emacs-startup-hook (lambda () (setq gc-cons-threshold 8000000)))
+6
View File
@@ -16,6 +16,12 @@
(package-refresh-contents)
(package-install 'use-package))
(use-package benchmark-init
:ensure t
:config
;; To disable collection of benchmark data after init is complete
(add-hook 'after-init-hook 'benchmark-init/deactivate))
;; -------------------------------------
;; Tangle and load configuration file
+2 -2
View File
@@ -4,6 +4,6 @@
# --
class ${1:Name} {
public:
${1:$(yas-c++-class-name yas-text)}();
${2:virtual ~${1:$(yas-c++-class-name yas-text)}();}$0
${1:$(yas-c++-class-name yas-text)}();
${2:virtual ~${1:$(yas-c++-class-name yas-text)}();}$0
};
+1 -1
View File
@@ -6,4 +6,4 @@ namespace ${1:Namespace} {
$0
}
} // namespace $1
+3
View File
@@ -1,3 +1,6 @@
# DO NOT EDIT! This file will be overwritten by LXAppearance.
# Any customization should be done in ~/.gtkrc-2.0.mine instead.
gtk-theme-name="Arc-Dark"
gtk-icon-theme-name="Arc"
gtk-font-name="DejaVu Sans 10"
+2 -2
View File
@@ -13,8 +13,8 @@ set $mod2 Mod1
floating_modifier $mod
# Application startup
exec_always --no-startup-id $HOME/.scripts/wm/wallpaper.sh &
exec_always --no-startup-id $HOME/.scripts/panel/polybar.sh &
exec_always --no-startup-id $HOME/.local/bin/wm/wallpaper.sh &
exec_always --no-startup-id $HOME/.local/bin/panel/polybar.sh &
exec --no-startup-id firefox &
exec --no-startup-id urxvt &
exec --no-startup-id thunar &
+110
View File
@@ -0,0 +1,110 @@
# -*- conf -*-
#--- Account ---#
IMAPAccount info
Host mail.riyyi.com
Port 993
UserCmd "gpg2 -q --for-your-eyes-only --no-tty -d ~/.config/emacs/etc/authinfo.gpg | awk -F ' ' '/info/ { print $(NF-2); exit; }'"
PassCmd "gpg2 -q --for-your-eyes-only --no-tty -d ~/.config/emacs/etc/authinfo.gpg | awk -F ' ' '/info/ { print $NF; exit; }'"
# SSL
SSLType IMAPS
SSLVersions TLSv1.3
CertificateFile /etc/ssl/certs/ca-certificates.crt
#--- Remote ---#
IMAPStore info-remote
Account info
#--- Local ---#
MaildirStore info-local
# IMAP subfolders represent local subfolders
SubFolders Verbatim
# The trailing "/" is important
Path ~/mail/info/
Inbox ~/mail/info/Inbox
#--- Sync ---#
Channel info
Far :info-remote:
Near :info-local:
# Automatically create missing mailboxes, only locally
Create Near
# Do not permanently remove all messages marked for deletion
Expunge None
# Include everything
Patterns *
# Save the synchronization state files in the relevant directory
SyncState *
# Make sure the date of the arrival stays the same when you move messages around
CopyArrivalDate yes
# ------------------------------------------
#--- Account ---#
IMAPAccount private
Host mail.riyyi.com
Port 993
UserCmd "gpg2 -q --for-your-eyes-only --no-tty -d ~/.config/emacs/etc/authinfo.gpg | awk -F ' ' '/private/ { print $(NF-2); exit; }'"
PassCmd "gpg2 -q --for-your-eyes-only --no-tty -d ~/.config/emacs/etc/authinfo.gpg | awk -F ' ' '/private/ { print $NF; exit; }'"
# SSL
SSLType IMAPS
SSLVersions TLSv1.3
CertificateFile /etc/ssl/certs/ca-certificates.crt
#--- Remote ---#
IMAPStore private-remote
Account private
#--- Local ---#
MaildirStore private-local
# IMAP subfolders represent local subfolders
SubFolders Verbatim
# The trailing "/" is important
Path ~/mail/private/
Inbox ~/mail/private/Inbox
#--- Sync ---#
Channel private
Far :private-remote:
Near :private-local:
# Automatically create missing mailboxes, only locally
Create Near
# Do not permanently remove all messages marked for deletion
Expunge None
# Include everything
Patterns *
# Save the synchronization state files in the relevant directory
SyncState *
# Make sure the date of the arrival stays the same when you move messages around
CopyArrivalDate yes
# ------------------------------------------
# https://www.gnu.org/software/emacs/manual/html_node/smtpmail/Authentication.html
# Example config:
# machine fullname login "<FULL_NAME>"
# machine info port 993 login <MAIL> password <SECRET>
# machine private port 993 login <MAIL> password <SECRET>
# machine mail.riyyi.com port 587 login <MAIL> password <SECRET>
# machine mail.riyyi.com port 587 login <MAIL> password <SECRET>
# Create password file:
# $ touch ~/.config/emacs/etc/authinfo.gpg
# $ echo "<CONFIG>" > ~/.config/emacs/etc/authinfo.gpg
# $ gpg -e -r <MAIL_USED_FOR_GPG> ~/.config/emacs/etc/authinfo.gpg
# Run to sync mail:
# $ mbsync -a -c ~/.config/isync/mbsyncrc
# Initialize mu:
# mu init --maildir=~/mail --my-address=<MAIL> --my-address=<MAIL2>
# mu index
# Packages:
# isync
# mu (AUR)
+1 -1
View File
@@ -6,7 +6,7 @@ pinentry = /usr/bin/pinentry
database_1 = ~/documents/password.kdbx
pw_cache_period_min = 60
gui_editor=emacsclient
gui_editor = emacsclient
editor = vim
terminal = urxvt
type_library = xdotool
+1 -1
View File
@@ -38,7 +38,7 @@ text/css=emacsclient.desktop
text/html=firefox.desktop
text/markdown=emacsclient.desktop
text/plain=emacsclient.desktop
text/plain=org.gnome.gedit.desktop
text/plain=emacsclient.desktop
text/x-c++src=emacsclient.desktop
text/x-cmake=emacsclient.desktop
text/x-csrc=emacsclient.desktop
+4 -4
View File
@@ -16,10 +16,10 @@ Alt+Shift+LEFT add video-rotate -90
Alt+- add video-zoom -0.25
Alt+= add video-zoom 0.25
# Video pan
Alt+LEFT add video-pan-x 0.05
Alt+RIGHT add video-pan-x -0.05
Alt+DOWN add video-pan-y -0.05
Alt+UP add video-pan-y 0.05
Alt+LEFT add video-pan-x -0.05
Alt+RIGHT add video-pan-x 0.05
Alt+DOWN add video-pan-y 0.05
Alt+UP add video-pan-y -0.05
Alt+h add video-pan-x -0.05
Alt+l add video-pan-x 0.05
Alt+j add video-pan-y 0.05
+2 -2
View File
@@ -11,11 +11,11 @@ listview {
}
element-icon {
margin: 0.05em 0 0.05em 0.2em;
padding: 0.05em 0 0.05em 0.2em;
size: 1em;
}
element-text {
background-color: default;
margin: 0.05em 0 0.05em 0.3em;
padding: 0.05em 0 0.05em 0.3em;
}
+4
View File
@@ -144,6 +144,10 @@ endfunction
"" Keybindings
" Change default behavior
nnoremap Y y$
vnoremap p pgvy
" Tab/Shift+Tab functionality
nnoremap <Tab> >>_
nnoremap <S-Tab> <<_
+20 -1
View File
@@ -3,6 +3,9 @@
# Disable Ctrl+S and Ctrl+Q
stty -ixon
# Use hard tabs
stty tab0
# Set tab width
tabs -4
@@ -45,10 +48,26 @@ zstyle ':vcs_info:*' formats '%F{cyan}(%F{red}%b%F{cyan})%f %c%u'
compinit -d "$XDG_CACHE_HOME/zsh/zcompdump"
zstyle ':completion::complete:*' use-cache 1
zstyle ':completion::complete:*' cache-path "$XDG_CACHE_HOME/zsh/zcompcache"
zstyle ':completion:*:options' auto-description '%d'
zstyle ':completion:*:default' list-colors ''
zstyle ':completion:*:default' list-prompt ''
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
zstyle ':completion:*' list-colors ''
zstyle ':completion:*' menu select
zstyle ':completion:*' group-name ''
zstyle ':completion:*' list-dirs-first true
zstyle ':completion:*' verbose yes
zstyle ':completion:*:default' list-prompt '%S%M matches%s'
zstyle ':completion:*:matches' group 'yes'
zstyle ':completion:*:options' description 'yes'
# Completion formatting
zstyle ':completion:*' format ' %F{yellow}-- %d --%f'
zstyle ':completion:*:corrections' format ' %F{green}-- %d (errors: %e) --%f'
zstyle ':completion:*:descriptions' format ' %F{yellow}-- %d --%f'
zstyle ':completion:*:messages' format ' %F{purple} -- %d --%f'
zstyle ':completion:*:warnings' format ' %F{red}-- no matches found --%f'
# Bind keys
zle -N history-beginning-search-backward-end history-search-end
zle -N history-beginning-search-forward-end history-search-end
+2 -2
View File
@@ -42,13 +42,13 @@ play() {
if [ -z "$1" ]; then
MPV="$MPV $CLIP"
# Cut off everything after space
LINK=" $(echo "$CLIP" | sed -nE 's/^(\S+).*/\1/p')"
LINK="$(echo "$CLIP" | sed -nE 's/^(\S+).*/\1/p')"
else
MPV="$MPV $*"
# Determain which argument holds the urls
[ "$1" = "${1#-}" ] && DISPLAY="$1" || DISPLAY="$2"
# Cut off everything after space
LINK=" $(echo "$DISPLAY" | sed -nE 's/^(\S+).*/\1/p')"
LINK="$(echo "$DISPLAY" | sed -nE 's/^(\S+).*/\1/p')"
fi
notify-send -t 2500 "Loading video: $LINK"
+4 -1
View File
@@ -7,9 +7,11 @@
#
# Entries in this file show the compile time defaults. Local configuration
# should be created by either modifying this file, or by creating "drop-ins" in
# the system.conf.d/ subdirectory. The latter is generally recommended.
# the login.conf.d/ subdirectory. The latter is generally recommended.
# Defaults can be restored by simply deleting this file and all drop-ins.
#
# Use 'systemd-analyze cat-config systemd/logind.conf' to display the full config.
#
# See logind.conf(5) for details.
[Login]
@@ -27,6 +29,7 @@ HandlePowerKey=ignore
#HandleLidSwitchExternalPower=suspend
#HandleLidSwitchDocked=ignore
#HandleRebootKey=reboot
#HandleRebootKeyLongPress=poweroff
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
+33 -7
View File
@@ -1,6 +1,8 @@
acpi
adobe-source-han-sans-jp-fonts
alsa-utils
android-studio
android-tools
arandr
arc-gtk-theme
arc-icon-theme
@@ -8,7 +10,6 @@ aria2
aspell-en
aspell-nl
base
breeze-icons
brightnessctl
bspwm
capitaine-cursors
@@ -23,8 +24,10 @@ domoticz-git
dos2unix
downgrade
doxygen
duf
dunst
ebtables
edk2-ovmf
efibootmgr
emacs
evtest
@@ -34,7 +37,6 @@ ffmpegthumbnailer
firefox
frei0r-plugins
fritzing
galculator-gtk2
gdb
gedit
ghc
@@ -42,6 +44,7 @@ git
gnome-calculator
gnome-keyring
gnome-themes-extra
gparted
graphviz
gst-plugins-good
gucharmap
@@ -55,19 +58,25 @@ imagemagick
inetutils
inkscape
intel-media-driver
intel-media-sdk
intel-ucode
isync
iw
jdk11-openjdk
jdownloader2
jq
kcachegrind
kdenlive
keepmenu-git
kolourpaint
kotlin-language-server-git
krita
lib32-alsa-lib
lib32-alsa-plugins
lib32-glibc
lib32-libpulse
lib32-openal
lib32-vulkan-intel
libmtp
libnotify-id
libvirt
@@ -85,11 +94,14 @@ man-db
man-pages
mariadb
mdadm
mesa-demos
minted
mkvtoolnix-cli
moka-icon-theme-git
mpv
mu
mysql-workbench
namcap
ncdu
neofetch
nerd-fonts-dejavu-complete
@@ -99,7 +111,6 @@ ntfs-3g
openssh
otf-font-awesome
p7zip
packettracer
pacman-contrib
pamixer
pavucontrol
@@ -110,16 +121,21 @@ polybar
poppler-glib
pulseaudio
pulseaudio-alsa
python2-setuptools
python-adblock
python-beautifulsoup4
python-certifi
python-filelock
python-flask
python-google-api-python-client
python-google-auth-oauthlib
python-image
python-keepmenu-git
python-matplotlib
python-opengl
python-pycurl
python-pyqt5
python-pyusb
python-tqdm
python-watchdog
python-zstandard
qbittorrent
qemu
@@ -131,15 +147,19 @@ qt5-tools
r
redshift
reflector
renderdoc-bin
rofi
rsync
rtmpdump
rxvt-unicode
signal-desktop
smartmontools
sqlitebrowser
sshfs
stalonetray
streamlink
sxhkd
syncthing
synergy2-bin
sysfsutils
texlab
@@ -158,19 +178,24 @@ texlive-science
thunar
thunar-volman
thunderbird
tibia
tlp
tokei
tree
trizen
ttf-dejavu
ttf-joypixels
ttf-ms-win10
tumbler
tumbler-extra-thumbnailers
tumbler-git
unrar
unzip
usbutils
valgrind
ventoy-bin
vim-spell-nl
virt-manager
vulkan-intel
wget
wine-staging
wpa_supplicant
@@ -190,7 +215,8 @@ xorg-xprop
xorg-xrandr
xorg-xsetroot
xss-lock
youtube-dl
yt-dlp
yt-dlp-drop-in
zathura
zathura-pdf-mupdf
zip