1
0
mirror of https://github.com/alrayyes/dotfiles/ synced 2023-11-14 15:56:30 +00:00

Compare commits

..

9 Commits

Author SHA1 Message Date
Ryan Kes
ca53760a0d fix(neovim): fixed dwmblocks path 2020-12-20 16:40:14 +01:00
Ryan Kes
2b7692d1e2 fix(dwm): for emacs 2 processes are supposed to be running 2020-12-20 16:14:11 +01:00
Ryan Kes
af5f5af0cd feat: install bmon 2020-12-20 15:23:31 +01:00
Ryan Kes
c996f37348 fix(wal): fixed global variables for fish 2020-12-20 15:22:57 +01:00
Ryan Kes
05cc2dbe2f feat(sxhkd): split config feature into seperate ones for laptop/desktop 2020-12-20 15:21:50 +01:00
Ryan Kes
21996faf2d feat: updated icon 2020-12-20 15:20:26 +01:00
Ryan Kes
ca0f1bf852 fix: updated dwmblocks path 2020-12-20 15:19:57 +01:00
Ryan Kes
16493e30dc refactor: mailsync is now an sh shell script 2020-12-20 15:19:23 +01:00
Ryan Kes
b246fd42d9 feat(emacs): borrowed a couple of things from distrotubes config 2020-12-17 17:27:25 +01:00
14 changed files with 171 additions and 47 deletions

View File

@ -53,6 +53,7 @@ A repository of my personal configuration files.
* Applications installed by script * Applications installed by script
** Applications ** Applications
- [[https://github.com/sharkdp/bat][bat]] - [[https://github.com/sharkdp/bat][bat]]
- [[https://github.com/tgraf/bmon][bmon]]
- [[https://dystroy.org/broot/][broot]] - [[https://dystroy.org/broot/][broot]]
- [[https://brave.com/][brave]] - [[https://brave.com/][brave]]
- [[https://github.com/caffeine-ng/caffeine-ng][caffeine-ng]] - [[https://github.com/caffeine-ng/caffeine-ng][caffeine-ng]]

View File

@ -2,16 +2,19 @@
###---Start app if not running already---### ###---Start app if not running already---###
start_if_not_running() { start_if_not_running() {
count=1
###---iceweasel/firefox is weird---### ###---iceweasel/firefox is weird---###
if [ "$1" = "iceweasel" ]; then if [ "$1" = "iceweasel" ]; then
PROCESS_NAME="iceweasel|MainThread" PROCESS_NAME="iceweasel|MainThread"
elif [ "$1" = "element-desktop-nightly" ]; then elif [ "$1" = "element-desktop-nightly" ]; then
PROCESS_NAME="element-desktop" PROCESS_NAME="element-desktop"
elif [ "$1" = "emacs" ]; then
count=2
else else
PROCESS_NAME=$1 PROCESS_NAME=$1
fi fi
if [ "$(pgrep -u "$(id -u)" -x "$PROCESS_NAME" | wc -l)" -lt 1 ]; then if [ "$(pgrep -u "$(id -u)" -x "$PROCESS_NAME" | wc -l)" -lt $count ]; then
if command -v "$1"; then if command -v "$1"; then
eval "$1 &" eval "$1 &"
fi fi

View File

@ -1,6 +1,6 @@
* Table of Contents :TOC_3:noexport: * Table of Contents :TOC_3:noexport:
- [[#general-settings][General settings]] - [[#general-settings][General settings]]
- [[#variable-font-sizes-depending-on-screen-width-set-font-to-hack][Variable font sizes depending on screen width. Set font to Hack.]] - [[#variable-font-sizes-depending-on-screen-width-set-font-to-jetbrains-mono][Variable font sizes depending on screen width. Set font to JetBrains Mono.]]
- [[#theme-is-set-to-doom-molokai-from-doom-themes][Theme is set to doom-molokai from doom-themes]] - [[#theme-is-set-to-doom-molokai-from-doom-themes][Theme is set to doom-molokai from doom-themes]]
- [[#fetch-password-from-authinfo][Fetch password from authinfo]] - [[#fetch-password-from-authinfo][Fetch password from authinfo]]
- [[#set-relative-line-numbers][Set relative line numbers]] - [[#set-relative-line-numbers][Set relative line numbers]]
@ -36,7 +36,7 @@
- [[#open-mdx-files-in-markdown-mode][Open mdx files in markdown-mode]] - [[#open-mdx-files-in-markdown-mode][Open mdx files in markdown-mode]]
* General settings * General settings
** Variable font sizes depending on screen width. Set font to [[https://sourcefoundry.org/hack/][Hack]]. ** Variable font sizes depending on screen width. Set font to JetBrains Mono.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(defun set-font (font-size bigfont-size) (defun set-font (font-size bigfont-size)
(setq doom-font (font-spec :family "JetBrainsMono Nerd Font" :size font-size)) (setq doom-font (font-spec :family "JetBrainsMono Nerd Font" :size font-size))
@ -77,7 +77,7 @@
(use-package! projectile (use-package! projectile
:defer t :defer t
:config :config
(setq projectile-project-search-path '("~/devel/personal/" "~/devel/andthensome/" "~/Documents/" "~/dotfiles" "~/private-dotfiles", "~/devel/slip-box/"))) ; Default paths (setq projectile-project-search-path '("~/devel/personal/" "~/devel/andthensome/" "~/Documents/" "~/dotfiles" "~/private-dotfiles", "~/devel/slip-box/", "~/devel/andthensome/clients/"))) ; Default paths
#+END_SRC #+END_SRC
* [[https://github.com/jorgenschaefer/circe][Circe]] * [[https://github.com/jorgenschaefer/circe][Circe]]
** Connect to [[https://wiki.znc.in/ZNC][ZNC]]. Passwords are gotten from [[https://www.passwordstore.org/][Password Store]]. ** Connect to [[https://wiki.znc.in/ZNC][ZNC]]. Passwords are gotten from [[https://www.passwordstore.org/][Password Store]].
@ -135,6 +135,7 @@
(setq org-directory "~/Documents/org" (setq org-directory "~/Documents/org"
org-agenda-files (directory-files-recursively "~/Documents/org/" "\.org$") org-agenda-files (directory-files-recursively "~/Documents/org/" "\.org$")
org-log-done 'note org-log-done 'note
org-default-notes-file (expand-file-name "inbox.org" org-directory)
org-startup-with-inline-images t) org-startup-with-inline-images t)
#+END_SRC #+END_SRC
** [[https://github.com/alphapapa/org-protocol-capture-html][org-protocol-capture-html]] ** [[https://github.com/alphapapa/org-protocol-capture-html][org-protocol-capture-html]]

View File

@ -16,6 +16,7 @@
deft deft
doom ; what makes DOOM look the way it does doom ; what makes DOOM look the way it does
doom-dashboard ; a nifty splash screen for Emacs doom-dashboard ; a nifty splash screen for Emacs
(emoji + unicode) ; ☺
hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
modeline ; snazzy, Atom-inspired modeline, plus API modeline ; snazzy, Atom-inspired modeline, plus API
;;nav-flash ; blink the current line after jumping ;;nav-flash ; blink the current line after jumping
@ -45,8 +46,8 @@
(dired +icons +ranger) (dired +icons +ranger)
electric electric
(ibuffer +icons) (ibuffer +icons)
vc
(undo +tree) (undo +tree)
vc
:term :term
;;eshell ; a consistent, cross-platform shell (WIP) ;;eshell ; a consistent, cross-platform shell (WIP)
@ -64,6 +65,7 @@
(docker +lsp) (docker +lsp)
editorconfig editorconfig
(eval +overlay) (eval +overlay)
lookup
lsp lsp
magit magit
make make

View File

@ -1,7 +1,7 @@
#!/usr/bin/env fish #!/usr/bin/env fish
# Prerequisite & inistalled apps # Prerequisite & inistalled apps
set prerequisiteApps bat broot brave caffeine-ng exa fslint fzf graphviz isync imagemagick lightdm-gtk-greeter mailcap neofetch npm pandoc-bin pamixer playerctl pulseaudio pulsemixer python pywal ripgrep stow sxiv tldr trayer udisks2 unclutter xbanish xwallpaper yarn xprop zathura set prerequisiteApps bat bmon broot brave caffeine-ng exa fslint fzf graphviz isync imagemagick lightdm-gtk-greeter mailcap neofetch npm pandoc-bin pamixer playerctl pulseaudio pulsemixer python pywal ripgrep stow sxiv tldr trayer udisks2 unclutter xbanish xwallpaper yarn xprop zathura
set prerequisiteFonts ttf-linux-libertine noto-fonts noto-fonts-emoji ttf-liberation nerd-fonts-hack set prerequisiteFonts ttf-linux-libertine noto-fonts noto-fonts-emoji ttf-liberation nerd-fonts-hack
set prerequisiteLibraries libxft-bgra set prerequisiteLibraries libxft-bgra
set prerequisiteLsp bash-language-server ccls php-language-server python-language-server typescript-language-server-bin vscode-css-languageserver-bin vscode-html-languageserver-bin nodejs-intelephense set prerequisiteLsp bash-language-server ccls php-language-server python-language-server typescript-language-server-bin vscode-css-languageserver-bin vscode-html-languageserver-bin nodejs-intelephense
@ -94,6 +94,7 @@ mkdir_if_not_exist ~/.config/mpv/scripts
mkdir_if_not_exist ~/.config/coc/extensions mkdir_if_not_exist ~/.config/coc/extensions
mkdir_if_not_exist ~/.config/dmenu-frecency mkdir_if_not_exist ~/.config/dmenu-frecency
mkdir_if_not_exist ~/.config/doom mkdir_if_not_exist ~/.config/doom
mkdir_if_not_exist ~/.config/sxhkd
# Link mpv plugins if they don't exist # Link mpv plugins if they don't exist

View File

@ -1,4 +1,4 @@
#!/usr/bin/env fish #!/bin/sh
# Sync mail and give notification if there is new mail. # Sync mail and give notification if there is new mail.
# Run only if user logged in (prevent cron errors) # Run only if user logged in (prevent cron errors)
@ -7,32 +7,36 @@ pgrep -u "$USER" >/dev/null || exit
pgrep -x mbsync >/dev/null && exit pgrep -x mbsync >/dev/null && exit
# Needed fo notify-send to work properly when called fron cronjob # Needed fo notify-send to work properly when called fron cronjob
set -x DISPLAY ":0.0" DISPLAY=":0.0"
# Sync accounts passed as argument or all. # Sync accounts passed as argument or all.
if count $argv >/dev/null if [ "$#" -eq "0" ]; then
set accounts $argv[1] accounts="$(awk '/^Group/ {print $2}' "$HOME/.config/mbsync/mbsyncrc")"
else else
set accounts (awk '/^Group/ {print $2}' "$HOME/.config/mbsync/mbsyncrc") for arg in "$@"; do
end [ "${arg%${arg#?}}" = '-' ] && opts="${opts:+${opts} }${arg}" && shift 1
done
accounts=$*
fi
pkill -RTMIN+6 "${STATUSBAR:-dwmblocks}"
# Parallelize multiple accounts # Parallelize multiple accounts
for account in $accounts for account in $accounts; do
# Check account for new mail. Notify if there is new content. # Check account for new mail. Notify if there is new content.
set acc (echo "$account" | sed "s/.*\///") acc="$(echo "$account" | sed "s/.*\///")"
mbsync -c ~/.config/mbsync/mbsyncrc "$acc" mbsync -c ~/.config/mbsync/mbsyncrc "$acc"
set new (find "$HOME/.local/share/mail/$acc/INBOX/new/" "$HOME/.local/share/mail/$acc/Inbox/new/" "$HOME/.local/share/mail/$acc/inbox/new/" -type f -newer "/tmp/.mailsynclastrun" 2> /dev/null) new="$(find "$HOME/.local/share/mail/$acc/INBOX/new/" "$HOME/.local/share/mail/$acc/Inbox/new/" "$HOME/.local/share/mail/$acc/inbox/new/" -type f -newer "/tmp/.mailsynclastrun" 2>/dev/null)"
set newcount (echo "$new" | sed '/^\s*$/d' | wc -l) newcount="$(echo "$new" | sed '/^\s*$/d' | wc -l)"
if [ $newcount -gt "0" ] if [ "$newcount" -gt "0" ]; then
# notify-send.py -i mutt -c mailtotal "Mail" "$newcount new mail(s) in \`$acc\` account." & # notify-send.py -i mutt -c mailtotal "Mail" "$newcount new mail(s) in \`$acc\` account." &
for file in $new for file in $new; do
# Extract subject and sender from mail. # Extract subject and sender from mail.
set from (awk '/^From: / && ++n ==1,/^\<.*\>:/' "$file" | perl -CS -MEncode -ne 'print decode("MIME-Header", $_)' | awk '{ $1=""; if (NF>=3)$NF=""; print $0 }' | sed 's/^[[:blank:]]*[\"'\''\<]*//;s/[\"'\''\>]*[[:blank:]]*$//') from="$(awk '/^From: / && ++n ==1,/^\<.*\>:/' "$file" | perl -CS -MEncode -ne 'print decode("MIME-Header", $_)' | awk '{ $1=""; if (NF>=3)$NF=""; print $0 }' | sed 's/^[[:blank:]]*[\"'\''\<]*//;s/[\"'\''\>]*[[:blank:]]*$//')"
set subject (awk '/^Subject: / && ++n == 1,/^\<.*\>: / && ++i == 2' "$file" | head -n-1 | perl -CS -MEncode -ne 'print decode("MIME-Header", $_)' | sed 's/^Subject: //' | sed 's/^{[[:blank:]]*[\"'\''\<]*//;s/[\"'\''\>]*[[:blank:]]*$//' | tr -d '\n') subject="$(awk '/^Subject: / && ++n == 1,/^\<.*\>: / && ++i == 2' "$file" | head -n-1 | perl -CS -MEncode -ne 'print decode("MIME-Header", $_)' | sed 's/^Subject: //' | sed 's/^{[[:blank:]]*[\"'\''\<]*//;s/[\"'\''\>]*[[:blank:]]*$//' | tr -d '\n')"
notify-send.py -i mutt "$from:" "$subject" & notify-send.py -i mutt "$from:" "$subject" &
end done
end fi
end done
wait wait
@ -40,3 +44,4 @@ mu index --muhome=~/.cache/mu --maildir=~/.local/share/mail 2>/dev/null
# Create a touch file that indicates the time of the last run of mailsync # Create a touch file that indicates the time of the last run of mailsync
touch "/tmp/.mailsynclastrun" touch "/tmp/.mailsynclastrun"
pkill -RTMIN+6 "${STATUSBAR:-dwmblocks}"

View File

@ -76,7 +76,7 @@
" } " }
" AutoRestart { " AutoRestart {
autocmd BufWritePost ~/devel/personal/dwmblocks/blocks.h !cd ~/devel/personal/dwmblocks/; sudo make install && killall -q dwmblocks && setsid dwmblocks & autocmd BufWritePost ~/devel/personal/suckless/dwmblocks/blocks.h !cd ~/devel/personal/suckless/dwmblocks/; sudo make install && killall -q dwmblocks && setsid dwmblocks &
autocmd BufWritePost ~/dotfiles/public/dunst/.config/dunst/dunstrc.thinkpad !killall -q dunst && setsid dunst & autocmd BufWritePost ~/dotfiles/public/dunst/.config/dunst/dunstrc.thinkpad !killall -q dunst && setsid dunst &
autocmd BufWritePost ~/dotfiles/public/dunst/.config/dunst/dunstrc.desktop !killall -q dunst && setsid dunst & autocmd BufWritePost ~/dotfiles/public/dunst/.config/dunst/dunstrc.desktop !killall -q dunst && setsid dunst &

View File

@ -4,7 +4,7 @@ ping -q -c 1 example.org >/dev/null || exit
/usr/bin/notify-send "📰 Updating RSS feeds..." /usr/bin/notify-send "📰 Updating RSS feeds..."
pgrep -f newsboat$ && /usr/bin/xdotool key --window "$(/usr/bin/xdotool search --name newsboat)" R && exit pgrep -f newsboat$ && /usr/bin/xdotool key --window "$(/usr/bin/xdotool search --name newsboat)" R && exit
echo 🔃 >/tmp/newsupdate echo "📰📻🔃" >/tmp/newsupdate
pkill -RTMIN+4 "${STATUSBAR:-dwmblocks}" pkill -RTMIN+4 "${STATUSBAR:-dwmblocks}"
/usr/bin/newsboat -x reload /usr/bin/newsboat -x reload
rm -f /tmp/newsupdate rm -f /tmp/newsupdate

View File

@ -0,0 +1,88 @@
#-----------------------------------------------------------Functions--------------------------------------------------------------
# lock screen
super + F1
xset s activate
# dmenu password selector
super + F2
~/.local/bin/pass-dmenu
# dmenu authenticator
super + F3
~/.local/bin/oath-dmenu
# ssh shell
super + F4
~/.local/bin/ssh-dmenu -p SSH:
# player controls
super + F5
playerctl stop
super + F6
playerctl previous
super + F7
playerctl play-pause
super + F8
playerctl next
# Wireguard
super + F11
~/.local/bin/wireguard-switch
# dmenu calculator
super + F12
=
#-----------------------------------------------------------Audio & screen brightness & shutdown--------------------------------------------------------------
# Audio controls
XF86AudioRaiseVolume
~/.local/bin/volume inc
XF86AudioLowerVolume
~/.local/bin/volume dec
XF86AudioMute
~/.local/bin/volume mute
# Screen brightness controls
XF86MonBrightnessUp
~/.local/bin/brightness inc
XF86MonBrightnessDown
~/.local/bin/brightness dec
# Shutdown / reboot
XF86Eject
prompt "Shutdown computer?" "sudo -A shutdown -h now"
shift + XF86Eject
prompt "Reboot computer?" "sudo -A reboot"
#-----------------------------------------------------------Screenshots--------------------------------------------------------------
shift + Print
maimpick
# desktop screenshot
Print
TIMESTAMP=$(date '+%Y-%m-%d-%H%M%S'); maim ~/Pictures/Screenshots/pic-full-$TIMESTAMP.png && notify-send -i ~/Pictures/Screenshots/pic-full-$TIMESTAMP.png "Desktop Screenshot pic-full-$TIMESTAMP.png"
#-----------------------------------------------------------App shortcuts--------------------------------------------------------------
# terminal emulator
super + Return
st
# program launcher
super + @space
dmenu-frecency
# make sxhkd reload its configuration files:
super + Escape
pkill -USR1 -x sxhkd
# Misc apps
super + ctrl + alt + {l, n, r, s, c, v, k, a, u, e}
$TERMINAL -e {lf, neomutt, /usr/bin/newsboat, spt, castero, nvim, ~/.local/bin/calendar-and-wait, ~/.local/bin/audit, ~/.local/bin/update-arch}
super + ctrl + alt + {b, e, S}
{brave, emacs, spotify}
super + ctrl + alt + {t}
~/.local/bin/tldr-dmenu
super + ctrl + alt + {m}
~/.local/bin/dmenuunicode
super + ctrl + alt + {w}
alacritty --class fullscreen,fullscreen -e ~/.config/polybar/bin/wttr-and-wait

View File

@ -0,0 +1,3 @@
#!/usr/bin/env sh
khal list && read -n 1 -p ""

17
sxhkd/.local/bin/sxhkd/volume Executable file
View File

@ -0,0 +1,17 @@
#!/bin/sh
if [ -n "$1" ]; then
case $1 in
inc)
pamixer --allow-boost -i 3
;;
dec)
pamixer --allow-boost -d 3
;;
mute)
pamixer -t
;;
esac
fi
pkill -RTMIN+15 "${STATUSBAR:-dwmblocks}"

View File

@ -0,0 +1,3 @@
#!/usr/bin/env fish
wttr && read -n 1 -p ""

View File

@ -1,32 +1,32 @@
# Shell variables # Shell variables
# Generated by 'wal' # Generated by 'wal'
set -g wallpaper "{wallpaper}" set -xg wallpaper "{wallpaper}"
# Special # Special
set -g background "{background}" set -xg background "{background}"
set -g foreground "{foreground}" set -xg foreground "{foreground}"
set -g cursor '{cursor}' set -xg cursor '{cursor}'
# Colors # Colors
set -g color0 "{color0}" set -xg color0 "{color0}"
set -g color1 "{color1}" set -xg color1 "{color1}"
set -g color2 "{color2}" set -xg color2 "{color2}"
set -g color3 "{color3}" set -xg color3 "{color3}"
set -g color4 "{color4}" set -xg color4 "{color4}"
set -g color5 "{color5}" set -xg color5 "{color5}"
set -g color6 "{color6}" set -xg color6 "{color6}"
set -g color7 "{color7}" set -xg color7 "{color7}"
set -g color8 "{color8}" set -xg color8 "{color8}"
set -g color9 "{color9}" set -xg color9 "{color9}"
set -g color10 "{color10}" set -xg color10 "{color10}"
set -g color11 "{color11}" set -xg color11 "{color11}"
set -g color12 "{color12}" set -xg color12 "{color12}"
set -g color13 "{color13}" set -xg color13 "{color13}"
set -g color14 "{color14}" set -xg color14 "{color14}"
set -g color15 "{color15}" set -xg color15 "{color15}"
# FZF colors # FZF colors
set -g -a FZF_DEFAULT_OPTS "--color fg:7,bg:0,hl:1,fg+:232,bg+:1,hl+:255 --color info:7,prompt:2,spinner:1,pointer:232,marker:1" set -xg -a FZF_DEFAULT_OPTS "--color fg:7,bg:0,hl:1,fg+:232,bg+:1,hl+:255 --color info:7,prompt:2,spinner:1,pointer:232,marker:1"
# Fix LS_COLORS being unreadable. # Fix LS_COLORS being unreadable.
set -g -a LS_COLORS ":su=30;41:ow=30;42:st=30;44:" set -xg -a LS_COLORS ":su=30;41:ow=30;42:st=30;44:"