From 70e19a1b38c94f548df6874e32479b29279505f8 Mon Sep 17 00:00:00 2001 From: Smirnov Olexandr Date: Tue, 29 Dec 2020 21:01:28 +0200 Subject: [PATCH] Add doom emacs config --- bin/catfetch | 13 ++- config/i3/config | 6 +- doom.d/README.md | 8 ++ doom.d/config.el | 6 ++ doom.d/custom.el | 3 + doom.d/init.el | 168 ++++++++++++++++++++++++++++++++++++ doom.d/packages.el | 3 + script/dmenu/dmenu-power.sh | 8 +- script/spectrwm-bar.sh | 38 -------- zshrc | 28 ++++-- 10 files changed, 218 insertions(+), 63 deletions(-) create mode 100644 doom.d/README.md create mode 100644 doom.d/config.el create mode 100644 doom.d/custom.el create mode 100644 doom.d/init.el create mode 100644 doom.d/packages.el delete mode 100755 script/spectrwm-bar.sh diff --git a/bin/catfetch b/bin/catfetch index fc86a09..8024267 100755 --- a/bin/catfetch +++ b/bin/catfetch @@ -12,18 +12,17 @@ kernel=$(cat /proc/sys/kernel/osrelease|cut -d '-' -f1) shell=$(basename $SHELL) # Pakages -manager=$(which dnf apt pacman apk yay xbps-query 2>/dev/null) +manager=$(which apt pacman yay apk xbps-query 2>/dev/null) manager=${manager##*/} case "$manager" in apt) packages="$(dpkg-query -f '${binary:Package}\n' -W | wc -l)";; pacman) packages="$(pacman -Q | wc -l)";; - apk) packages="$(apk list --installed | wc -l)";; yay) packages="$(yay -Q | wc -l)";; + apk) packages="$(apk list --installed | wc -l)";; xbps-query) packages="$(xbps-query -l | wc -l)";; esac - # Colors #### bold="\e[1m" reset="\e[0m" @@ -39,9 +38,9 @@ magenta='\e[35m' cyan='\e[36m' white='\e[37m' -echo -e " ${blue}${bold} WM ${reset}${wmname}" -echo -e " /\_/\ ${blue}${bold} SHELL ${reset}${shell}" -echo -e " (=^.^=) ${blue}${bold}KERNEL ${reset}${kernel}" -echo -e " (\") (\")_/ ${blue}${bold} PKG ${reset}${packages}" +echo -e " ${blue}${bold} WM ${reset}${wmname}" +echo -e " /\_/\ ${blue}${bold} SHELL ${reset}${shell}" +echo -e " (=^.^=) ${blue}${bold}KERNEL ${reset}${kernel}" +echo -e " (\") (\")_/ ${blue}${bold} PKG ${reset}${packages}" echo -e " ${black}卑${red}卑${green}卑${yellow}卑${blue}卑${magenta}卑${cyan}卑${reset} " exit 0 diff --git a/config/i3/config b/config/i3/config index 91e8cea..9c47ee9 100644 --- a/config/i3/config +++ b/config/i3/config @@ -25,9 +25,9 @@ exec --no-startup-id exec picom --experimental-backends -b exec --no-startup-id exec nitrogen --restore exec --no-startup-id exec setxkbmap "us,ua" ",winkeys" "grp:alt_shift_toggle" -option "ctrl:nocaps" exec --no-startup-id exec org.telegram.desktop -exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 -exec --no-startup-id xautolock -time 3 -locker "betterlockscreen --off 180 -t \"Computer is lockerd\" -l" -exec_always --no-startup-id $HOME/.config/i3/bar.sh +exec --no-startup-id exec /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 +exec_always --no-startup-id exec xautolock -time 3 -locker "betterlockscreen --off 180 -t \"Computer is lockerd\" -l" +exec_always --no-startup-id exec $HOME/.config/i3/bar.sh #exec --no-startup-id exec conky #exec --no-startup-id exec redshift-gtk #exec --no-startup-id exec discord diff --git a/doom.d/README.md b/doom.d/README.md new file mode 100644 index 0000000..0e0228a --- /dev/null +++ b/doom.d/README.md @@ -0,0 +1,8 @@ +# Doom emacs + +### Install +~~~bash +sudo pacman -S emacs ripgrep fd +git clone --depth 1 https://github.com/hlissner/doom-emacs ~/.emacs.d +~/.emacs.d/bin/doom install +~~~ diff --git a/doom.d/config.el b/doom.d/config.el new file mode 100644 index 0000000..81cd5c7 --- /dev/null +++ b/doom.d/config.el @@ -0,0 +1,6 @@ +(setq user-full-name "Smirnov Alexandr" + user-mail-address "ss2316544@gmail.com") + +(setq doom-theme 'doom-one) +(setq org-directory "~/org/") +(setq display-line-numbers-type t) diff --git a/doom.d/custom.el b/doom.d/custom.el new file mode 100644 index 0000000..e505fa1 --- /dev/null +++ b/doom.d/custom.el @@ -0,0 +1,3 @@ +(custom-set-variables + '(package-selected-packages '(zoutline))) +(custom-set-faces) diff --git a/doom.d/init.el b/doom.d/init.el new file mode 100644 index 0000000..782ab8d --- /dev/null +++ b/doom.d/init.el @@ -0,0 +1,168 @@ +(doom! :input + ;;chinese + ;;japanese + ;;layout ; auie,ctsrnm is the superior home row + + :completion + company ; the ultimate code completion backend + ;;helm ; the *other* search engine for love and life + ;;ido ; the other *other* search engine... + ivy ; a search engine for love and life + + :ui + ;;deft ; notational velocity for Emacs + doom ; what makes DOOM look the way it does + doom-dashboard ; a nifty splash screen for Emacs + doom-quit ; DOOM quit-message prompts when you quit Emacs + (emoji +unicode) ; 🙂 + ;;fill-column ; a `fill-column' indicator + hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW + ;;hydra + ;;indent-guides ; highlighted indent columns + ;;ligatures ; ligatures and symbols to make your code pretty again + ;;minimap ; show a map of the code on the side + modeline ; snazzy, Atom-inspired modeline, plus API + ;;nav-flash ; blink cursor line after big motions + ;;neotree ; a project drawer, like NERDTree for vim + ophints ; highlight the region an operation acts on + (popup +defaults) ; tame sudden yet inevitable temporary windows + tabs ; a tab bar for Emacs + treemacs ; a project drawer, like neotree but cooler + unicode ; extended unicode support for various languages + vc-gutter ; vcs diff in the fringe + vi-tilde-fringe ; fringe tildes to mark beyond EOB + ;;window-select ; visually switch windows + workspaces ; tab emulation, persistence & separate workspaces + ;;zen ; distraction-free coding or writing + + :editor + (evil +everywhere) ; come to the dark side, we have cookies + ;;file-templates ; auto-snippets for empty files + fold ; (nigh) universal code folding + ;;(format +onsave) ; automated prettiness + ;;god ; run Emacs commands without modifier keys + ;;lispy ; vim for lisp, for people who don't like vim + ;;multiple-cursors ; editing in many places at once + ;;objed ; text object editing for the innocent + ;;parinfer ; turn lisp into python, sort of + ;;rotate-text ; cycle region at point between text candidates + ;;snippets ; my elves. They type so I don't have to + ;;word-wrap ; soft wrapping with language-aware indent + + :emacs + dired ; making dired pretty [functional] + electric ; smarter, keyword-based electric-indent + ;;ibuffer ; interactive buffer management + undo ; persistent, smarter undo for your inevitable mistakes + vc ; version-control and Emacs, sitting in a tree + + :term + eshell ; the elisp shell that works everywhere + ;;shell ; simple shell REPL for Emacs + ;;term ; basic terminal emulator for Emacs + ;;vterm ; the best terminal emulation in Emacs + + :checkers + syntax ; tasing you for every semicolon you forget + ;;spell ; tasing you for misspelling mispelling + ;;grammar ; tasing grammar mistake every you make + + :tools + ;;ansible + ;;debugger ; FIXME stepping through code, to help you add bugs + ;;direnv + ;;docker + ;;editorconfig ; let someone else argue about tabs vs spaces + ;;ein ; tame Jupyter notebooks with emacs + (eval +overlay) ; run code, run (also, repls) + ;;gist ; interacting with github gists + lookup ; navigate your code and its documentation + lsp + magit ; a git porcelain for Emacs + ;;make ; run make tasks from Emacs + ;;pass ; password manager for nerds + ;;pdf ; pdf enhancements + ;;prodigy ; FIXME managing external services & code builders + ;;rgb ; creating color strings + ;;taskrunner ; taskrunner for all your projects + ;;terraform ; infrastructure as code + ;;tmux ; an API for interacting with tmux + ;;upload ; map local to remote projects via ssh/ftp + + :os + (:if IS-MAC macos) ; improve compatibility with macOS + tty ; improve the terminal Emacs experience + + :lang + ;;agda ; types of types of types of types... + ;;cc ; C/C++/Obj-C madness + ;;clojure ; java with a lisp + ;;common-lisp ; if you've seen one lisp, you've seen them all + ;;coq ; proofs-as-programs + ;;crystal ; ruby at the speed of c + ;;csharp ; unity, .NET, and mono shenanigans + ;;data ; config/data formats + ;;(dart +flutter) ; paint ui and not much else + ;;elixir ; erlang done right + ;;elm ; care for a cup of TEA? + emacs-lisp ; drown in parentheses + ;;erlang ; an elegant language for a more civilized age + ;;ess ; emacs speaks statistics + ;;faust ; dsp, but you get to keep your soul + ;;fsharp ; ML stands for Microsoft's Language + ;;fstar ; (dependent) types and (monadic) effects and Z3 + ;;gdscript ; the language you waited for + (go +lsp) ; the hipster dialect + ;;(haskell +dante) ; a language that's lazier than I am + ;;hy ; readability of scheme w/ speed of python + ;;idris ; a language you can depend on + json ; At least it ain't XML + ;;(java +meghanada) ; the poster child for carpal tunnel syndrome + ;;javascript ; all(hope(abandon(ye(who(enter(here)))))) + ;;julia ; a better, faster MATLAB + ;;kotlin ; a better, slicker Java(Script) + ;;latex ; writing papers in Emacs has never been so fun + ;;lean + ;;factor + ;;ledger ; an accounting system in Emacs + ;;lua ; one-based indices? one-based indices + markdown ; writing docs for people to ignore + ;;nim ; python + lisp at the speed of c + ;;nix ; I hereby declare "nix geht mehr!" + ;;ocaml ; an objective camel + org ; organize your plain life in plain text + ;;php ; perl's insecure younger brother + ;;plantuml ; diagrams for confusing people more + ;;purescript ; javascript, but functional + python ; beautiful is better than ugly + ;;qt ; the 'cutest' gui framework ever + ;;racket ; a DSL for DSLs + ;;raku ; the artist formerly known as perl6 + ;;rest ; Emacs as a REST client + ;;rst ; ReST in peace + ;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"} + ;;rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap() + ;;scala ; java, but good + ;;scheme ; a fully conniving family of lisps + sh ; she sells {ba,z,fi}sh shells on the C xor + ;;sml + ;;solidity ; do you need a blockchain? No. + ;;swift ; who asked for emoji variables? + ;;terra ; Earth and Moon in alignment for performance. + ;;web ; the tubes + yaml ; JSON, but readable + + :email + ;;(mu4e +gmail) + ;;notmuch + ;;(wanderlust +gmail) + + :app + ;;calendar + ;;irc ; how neckbeards socialize + ;;(rss +org) ; emacs as an RSS reader + ;;twitter ; twitter client https://twitter.com/vnought + + :config + ;;literate + (default +bindings +smartparens)) diff --git a/doom.d/packages.el b/doom.d/packages.el new file mode 100644 index 0000000..fe0425a --- /dev/null +++ b/doom.d/packages.el @@ -0,0 +1,3 @@ +(package! rainbow-mode) +(package! async) +(package! go-autocomplete) diff --git a/script/dmenu/dmenu-power.sh b/script/dmenu/dmenu-power.sh index 6d4af49..733bc76 100755 --- a/script/dmenu/dmenu-power.sh +++ b/script/dmenu/dmenu-power.sh @@ -15,13 +15,7 @@ case "$choice" in esac ;; "Lock") - declare opt=("Yes\nNo") - yesno=$(echo -e "${opt[@]}" | dmenu -p 'Power' $@) - case "$yesno" in - "Yes") exec betterlockscreen --off 300 -t "Computer is lockerd" -l;; - "No") exec exit 0 ;; - esac - ;; + exec betterlockscreen --off 300 -t "Computer is lockerd" -l ;; "Logout") declare opt=("Yes\nNo") yesno=$(echo -e "${opt[@]}" | dmenu -p 'Logout' $@) diff --git a/script/spectrwm-bar.sh b/script/spectrwm-bar.sh deleted file mode 100755 index 4d1866f..0000000 --- a/script/spectrwm-bar.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash - -## WIFI SIGNAL -wifi() { - wifis=$(cat /proc/net/wireless | grep "wlp3s0" | awk '{print $4}' | grep -o '[0-9]*') - echo -e " $wifis%" -} - -## RAM -mem() { - mem=`free | awk '/Mem/ {printf "%dM/%dM\n", $3 / 1024.0, $2 / 1024.0 }'` - echo -e "$mem" -} - -## VOLUME -vol() { - vol=`amixer get Master | awk -F'[][]' 'END{ print $4":"$2 }' | sed 's/on://g'` - echo -e " $vol" -} - - -## KEYBOARD -keyl() { - case "$(xkblayout)" in - Eng) date="us";; - Rus) date="ru";; - Ukr) date="ua";; - esac - echo -e " $date" -} - - -SLEEP_SEC=0 -while :; do - echo "+@fg=2;$(keyl) +@fg=0; +@fg=3;$(vol) +@fg=0; +@fg=4;$(wifi) +@fg=0;" - sleep $SLEEP_SEC -done - diff --git a/zshrc b/zshrc index bfd2fca..019441d 100644 --- a/zshrc +++ b/zshrc @@ -17,7 +17,7 @@ ZSH_THEME="cyan-simple" # Set theme export UPDATE_ZSH_DAYS=7 # Change how often to auto-update. export LANG=en_US.UTF-8 # Set locale -plugins=(pip python golang pass sudo heroku git taskwarrior encode64) +plugins=(pip python golang pass emacs sudo heroku git taskwarrior encode64) source $ZSH/oh-my-zsh.sh @@ -34,12 +34,6 @@ function bgcolor { ### Aliases ### alias cls="clear" -alias :q="exit" -alias :q!="exit" -alias q="exit" -alias :qw="exit" -alias tmux="tmux -2" -alias vim="nvim" alias mkdir="mkdir -p" alias mkd="mkdir" alias sl="ls" @@ -48,12 +42,30 @@ alias du="du -sh" alias df="df -h" alias lns="ln -s" alias uln="unlink" + +# Program +alias vim="nvim" +alias tmux="tmux -2" alias ipython="ipython --no-banner" alias icat="kitty +kitten icat" +eval $(thefuck --alias) + +# Exit +alias :q="exit" +alias :q!="exit" +alias q="exit" +alias :qw="exit" + +# Navigation alias ..="cd .." alias ...="cd ../.." alias .3="cd ../../.." alias .4="cd ../../../.." alias .5="cd ../../../../.." alias .6="cd ../../../../../.." -eval $(thefuck --alias) + +# Doom emacs +alias doomsync="$HOME/.emacs.d/bin/doom sync" +alias doomupgrade="$HOME/.emacs.d/bin/doom upgrade" +alias doomdoctor="$HOME/.emacs.d/bin/doom doctor" +alias doom="$HOME/.emacs.d/bin/doom"