diff --git a/README.md b/README.md index 2b67812..a5685f7 100644 --- a/README.md +++ b/README.md @@ -8,10 +8,11 @@ I'm using: * [Oh My Zsh](http://ohmyz.sh) * [GNU stow](https://www.gnu.org/software/stow) * [Materia Theme](https://github.com/nana-4/materia-theme) + ## TODOS: ## 1. Update this README for the migration to GNU stow and clemacs 2. Making an own conky, conky_maia-like -..* [conky](https://github.com/brndnmtthws/conky/wiki/Configuraion-Settings) + * [conky](https://github.com/brndnmtthws/conky/wiki/Configuraion-Settings) 3. Sorting the "Prerequisites" by importance 4. Improve the README.md or maybe make a wiki. 5. Getting away from Manjaro i3 (?) @@ -55,6 +56,7 @@ Yaourt Install * [i3lock-color](https://github.com/PandorasFox/i3lock-color) - Needed for ~/.scripts/i3lock.py * [cava](https://github.com/karlstav/cava) - **C**onsole-based **A**udio **V**isualizer for **A**LSA (MPD and Pulseaudio) * [materia-theme](https://github.com/nana-4/materia-theme) + ``` shell sudo pacman -Syu sudo pacman -S emacs git termite python-pip zsh-theme-powerlevel9k powerline-fonts awesome-terminal-fonts texlive-most firefox thunderbird evince veracrypt keepassx2 xorg-xbacklight pulseaudio-alsa pulseaudio-bluetooth nyancat cmus lxappearance @@ -73,10 +75,6 @@ rm -rf ~/.*bash* # remove bash-stuff from your home directory.. don't do it if y ### Setting up Emacs ### I tried to make this as easy as possible. All packages should be installed automatically. I'm not sure whether it works or not -``` shell -curl -L https://github.com/bbatsov/prelude/raw/master/utils/installer.sh | sh -``` - ### Setups ### Setting up some programs. #### Installing Nextcloud-Client (optional) #### @@ -89,7 +87,9 @@ sudo ln -s ~/Downloads/Nextcloud-2.3.3-x86_64.AppImage /usr/bin/nextcloud #### Finally *"installing"* the dotfiles. #### ``` shell git clone https://github.com/TuDatTr/dotfiles .dotfiles -stow +stow emacs +stow i3 +stow zsh rm -rf ~/.i3/ sudo ln -s ~/.scripts/pipes.sh /usr/local/bin/pipes ``` diff --git a/emacs/.emacs.d/ac-comphist.dat b/emacs/.emacs.d/ac-comphist.dat new file mode 100644 index 0000000..bf0014b --- /dev/null +++ b/emacs/.emacs.d/ac-comphist.dat @@ -0,0 +1,4 @@ +((("defun" . + [0 0 0 1 0]) + ("wird" . + [2 0 0 0]))) diff --git a/emacs/.emacs.d/config.el b/emacs/.emacs.d/config.el index 9a6356b..b5dce72 100644 --- a/emacs/.emacs.d/config.el +++ b/emacs/.emacs.d/config.el @@ -33,6 +33,10 @@ '(lambda () (set-face-background 'default "unspecified-bg"))) +(f-mkdir "~/.emacs-saves") +(setq auto-save-file-name-transforms + '((".*" "~/.emacs-saves/" t))) + (defun copy-to-xclipboard(arg) (interactive "P") (cond @@ -91,10 +95,13 @@ (menu-bar-mode -1) +(ac-config-default) + (add-hook 'python-mode-hook 'anaconda-mode) (add-hook 'python-mode-hook 'anaconda-eldoc-mode) (require 'tex) +(require 'auto-complete-auctex) (setq TeX-auto-save t) (setq TeX-parse-self t) (setq-default TeX-master nil) @@ -113,10 +120,11 @@ (add-hook 'org-mode-hook 'rainbow-delimiters-mode) (counsel-mode 1) +(global-set-key "\C-s" 'swiper) (require 'paren) (setq show-paren-style 'parenthesis) -(show-paren-mode +1) +(show-paren-mode 1) (global-hl-line-mode 1) (set-face-background 'hl-line "#141b1e") @@ -142,3 +150,5 @@ :lighter " my-keys") (my-keys-minor-mode 1) + +(add-hook 'conf-mode 'rainbow-mode) diff --git a/emacs/.emacs.d/config.org b/emacs/.emacs.d/config.org index cf22ca2..bddde14 100644 --- a/emacs/.emacs.d/config.org +++ b/emacs/.emacs.d/config.org @@ -11,6 +11,7 @@ #+SELECT_TAGS: export * Packages +A list of installed packages and details about them. ** Package Archives Adding the melpa package repository to Emacs. #+BEGIN_SRC emacs-lisp @@ -73,8 +74,18 @@ Changes the Emacs background to the terminals defaults. (Generally) '(lambda () (set-face-background 'default "unspecified-bg"))) #+END_SRC +* Emacs behavior +Save auto-save files in ~/.emacs-save +#+BEGIN_SRC emacs-lisp +(f-mkdir "~/.emacs-saves") +(setq auto-save-file-name-transforms + '((".*" "~/.emacs-saves/" t))) +#+END_SRC + * Functions +All the functions I use. ** Cut/Copy and Paste by Boruch Baum +A nice way to copy and paste contents comfortably inside and out of emacs. *** Copy Copy the marked area to the clipboard. #+BEGIN_SRC emacs-lisp @@ -144,7 +155,8 @@ Go back to indentation, if you are at the indentation, go to beginning of the li #+END_SRC Sets the background of Emacs in terminal-mode to the terminals. Doesn't change it in window -mode tho. +mode though. +Function is not currently used since I still have to figure out how to make it work with emacs in daemon mode #+BEGIN_SRC emacs-lisp (defun transparent-terminal () (unless (display-graphic-p (selected-frame)) @@ -155,7 +167,11 @@ mode tho. #+BEGIN_SRC emacs-lisp (menu-bar-mode -1) #+END_SRC +** Autocomplete +#+BEGIN_SRC emacs-lisp +(ac-config-default) +#+END_SRC ** Python Using Anaconda-mode as default python development mode #+BEGIN_SRC emacs-lisp @@ -167,6 +183,7 @@ Some default settings for LaTeX-Mode. AucTeX is needed. #+BEGIN_SRC emacs-lisp (require 'tex) +(require 'auto-complete-auctex) (setq TeX-auto-save t) (setq TeX-parse-self t) (setq-default TeX-master nil) @@ -199,12 +216,13 @@ Add rainbow-delimiters in org-mode ** Ivy/Counsel/Swiper #+BEGIN_SRC emacs-lisp (counsel-mode 1) +(global-set-key "\C-s" 'swiper) #+END_SRC ** Parenthesis #+BEGIN_SRC emacs-lisp (require 'paren) (setq show-paren-style 'parenthesis) -(show-paren-mode +1) +(show-paren-mode 1) #+END_SRC ** Highlight line Globaly highlight the current line in a slightly darker shade of grey. @@ -221,7 +239,7 @@ Globaly highlight the current line in a slightly darker shade of grey. (yas-global-mode 1) #+END_SRC -** Personal mode +** Personal #+BEGIN_SRC emacs-lisp (defvar my-keys-minor-mode-map (let ((map (make-sparse-keymap))) @@ -239,3 +257,9 @@ Globaly highlight the current line in a slightly darker shade of grey. (my-keys-minor-mode 1) #+END_SRC + +** Conf +#+BEGIN_SRC emacs-lisp +(add-hook 'conf-mode 'rainbow-mode) +#+END_SRC + diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el index 86c578d..d9df59e 100644 --- a/emacs/.emacs.d/init.el +++ b/emacs/.emacs.d/init.el @@ -7,7 +7,7 @@ ;; If there is more than one, they won't work right. '(package-selected-packages (quote - (counsel swiper material-theme anaconda-mode rainbow-mode ox-twbs google-this auctex smartparens eclim flycheck rainbow-delimiters forest-blue-theme)))) + (auto-complete-auctex auto-complete counsel swiper material-theme anaconda-mode rainbow-mode ox-twbs google-this auctex smartparens eclim flycheck rainbow-delimiters forest-blue-theme)))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. diff --git a/emacs/.emacs.d/tramp b/emacs/.emacs.d/tramp new file mode 100644 index 0000000..44f980c --- /dev/null +++ b/emacs/.emacs.d/tramp @@ -0,0 +1,20 @@ +;; -*- emacs-lisp -*- <18/01/15 17:18:27 /home/tuan/.emacs.d/tramp> +;; Tramp connection history. Don't change this file. +;; You can delete it, forcing Tramp to reapply the checks. + +((["ssh" "infra" "mx" nil nil] + ("uname" "Linux 4.4.0-109-generic") + ("locale" "LC_ALL=en_US.utf8") + ("test" "test") + ("remote-path" + ("/bin" "/usr/bin" "/sbin" "/usr/sbin" "/usr/local/bin" "/usr/local/sbin")) + ("remote-shell" "/bin/sh") + ("readlink" "\\readlink") + ("stat" nil) + ("perl-file-spec" t) + ("perl-cwd-realpath" t) + ("perl" "\\perl") + ("id" "/usr/bin/id") + ("gid-integer" 1000) + ("gid-string" "infra") + ("file-exists" "test -e"))) diff --git a/i3/.scripts/i3lock.py b/i3/.scripts/i3lock.py index d692e07..3a0bde5 100755 --- a/i3/.scripts/i3lock.py +++ b/i3/.scripts/i3lock.py @@ -1,4 +1,4 @@ -import datetime +import time import os from PIL import Image @@ -106,7 +106,14 @@ def lock_config(): lock_pic) -def log_command(command): +def lock(): + 'Locks the System' + command = lock_config() + + os.system(command) + + +def log(start_time): write_mode = '' home = os.path.expanduser('~') log_file_path = "{}/{}".format(home, ".scripts/lock.log") @@ -116,23 +123,18 @@ def log_command(command): else: write_mode = 'w' + program_duration = time.time() - start_time with open(log_file_path, write_mode) as f: - f.write("[{}] {}\n".format(str(datetime.datetime.now()), command)) + f.write("[{}] {} seconds runtime.\n".format(time.asctime(), program_duration)) f.close() - -def lock(): - 'Locks the System' - command = lock_config() - - log_command(command) - - os.system(command) - - + if __name__ == '__main__': + start_time = time.time() screenshot() pixelate() lock() + + log(start_time) diff --git a/zsh/.zshrc b/zsh/.zshrc index dbe0fd1..d56fc4d 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -65,5 +65,6 @@ alias dir="du -h -d 1" alias -s tex=emacs alias -s cpp=emacs alias org="e ~/Nextcloud/orgs/man.org" +alias neofetch="neofetch --block_range 0 16" source $ZSH/oh-my-zsh.sh export GPG_TTY=$(tty)