diff --git a/config/.local/share/ranger/bookmarks b/config/.local/share/ranger/bookmarks index 73b4c2a..4e35812 100644 --- a/config/.local/share/ranger/bookmarks +++ b/config/.local/share/ranger/bookmarks @@ -1,13 +1,13 @@ -u:/home/tuan/Documents/Uni/Studium +u:/home/tuan/Documents/Uni/Studium/2020&2021 Wintersemseter p:/home/tuan/Documents/Protokolle/FSE o:/home/tuan/.dotfiles/config m:/run/media -a:/home/tuan/Documents/Arbeit +a:/home/tuan/Documents/Uni/Studium/2020&2021 Wintersemseter/Programmierung in C-C++/Exercise/03/tran_3030462_ex03/task01 l:/home/tuan/Local c:/home/tuan/Documents/CTF t:/home/tuan/Templates w:/home/tuan/workspace_l/Projects k:/home/tuan/Documents/Uni/Studium/2017&2018 Wintersemester/Rechnerstrukturen und Betriebssysteme [4,0]/Rechnerstrukturen q:/home/tuan/.nextcloud/Quick Drop -':/home/tuan/.dotfiles/emacs/.emacs.d/snippets +':/home/tuan/.emacs.d/snippets/c++-mode e:/home/tuan/Documents/CTF/TryHackMe/Ice/2_Recon diff --git a/config/.scripts/project.sh b/config/.scripts/project.sh new file mode 100755 index 0000000..2854d56 --- /dev/null +++ b/config/.scripts/project.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +type xrandr >/dev/null 2>&1 || { echo >&2 "I require maim but it's not installed. Aborting."; exit 1; } + +mon0=eDPI1 +mon1=HDMI1 +case $1 in + "mon0"*) + xrandr --output $mon0 --auto + xrandr --output $mon1 --off + ;; + "duplicate"*) + xrandr --output $mon0 --auto + xrandr --output $mon1 --same-as $mon0 + ;; + "extend"*) + xrandr --output $mon0 --auto + xrandr --output $mon1 --left-of $mon0 + ;; + "mon1"*) + xrandr --output $mon0 --off + xrandr --output $mon1 --auto + ;; +esac diff --git a/config/.scripts/screenshot.sh b/config/.scripts/screenshot.sh index 935b7d2..c12658d 100755 --- a/config/.scripts/screenshot.sh +++ b/config/.scripts/screenshot.sh @@ -6,22 +6,23 @@ type xclip >/dev/null 2>&1 || { echo >&2 "I require xclip but it's not installed type xdotool >/dev/null 2>&1 || { echo >&2 "I require xdotool but it's not installed. Aborting."; exit 1; } d=$HOME/Pictures/Screenshots/$(date +%G-%m); +fd=$(date +%G-%m-%d_%H-%M-%S) case $1 in "screen"*) - filename=$(cat /proc/$(xdotool getwindowpid $(xdotool getwindowfocus))/comm)_$(date +%G-%m-%d_%H-%M-%S).png; + filename=$fd-$(cat /proc/$(xdotool getwindowpid $(xdotool getwindowfocus))/comm).png; maim -f png $d/$filename; dunstify -r 2 "Saved screenshot of screen in $d/$filename"; xclip -selection clipboard -t image/png -i $d/$filename ;; "window"*) - filename=$(cat /proc/$(xdotool getwindowpid $(xdotool getwindowfocus))/comm)_$(date +%G-%m-%d_%H-%M-%S).png + filename=$fd-$(cat /proc/$(xdotool getwindowpid $(xdotool getwindowfocus))/comm).png maim -u -i $(xdotool getactivewindow) -f png $d/$filename; dunstify -r 2 "Saved screenshot of window in $d/$filename"; xclip -selection clipboard -t image/png -i $d/$filename ;; "area"*) dunstify -r 2 'Taking screenshot from area.'; - filename=$(cat /proc/$(xdotool getwindowpid $(xdotool getwindowfocus))/comm)_$(date +%G-%m-%d_%H-%M-%S).png; + filename=$fd-$(cat /proc/$(xdotool getwindowpid $(xdotool getwindowfocus))/comm).png; maim -u -s -f png $d/$filename; dunstify -r 2 "Saved in $d/$filename."; xclip -selection clipboard -t image/png -i $d/$filename diff --git a/emacs/.emacs.d/config.org b/emacs/.emacs.d/config.org index e4793ab..e9643a7 100644 --- a/emacs/.emacs.d/config.org +++ b/emacs/.emacs.d/config.org @@ -141,9 +141,37 @@ =A template system for Emacs= #+begin_src emacs-lisp - (use-package yasnippet) + (use-package yasnippet + :config + (setq yas-snippet-dirs '("~/.emacs.d/snippets/")) + (yas-global-mode 1)) #+end_src +*** [[https://github.com/company-mode/company-mode][company-mode]] + =Modular in-buffer completion framework for Emacs= + + #+begin_src emacs-lisp + (use-package company + :config + (global-company-mode)) + #+end_src + +*** [[https://github.com/flycheck/flycheck][flycheck]] + =On the fly syntax checking for GNU Emacs= + + #+begin_src emacs-lisp + (use-package flycheck + :config + (global-flycheck-mode)) + #+end_src + +*** [[https://github.com/hniksic/emacs-htmlize][htmlize.el]] + =Convert buffer text and decorations to HTML.= + +#+begin_src emacs-lisp + (use-package htmlize) +#+end_src + * Appearance This section is for appearance customization. Either via packages or manually. @@ -183,15 +211,27 @@ (setq vc-follow-symlinks t) #+end_src +** Tab Behavior (spaces > tabs) + + #+BEGIN_SRC emacs-lisp + (setq-default indent-tabs-mode nil) + #+END_SRC + * Mode Configuration ** Org-Mode Enable org-bullets and hide leading stars. #+begin_src emacs-lisp (add-hook 'org-mode-hook - (lambda () - (org-bullets-mode 1))) + (lambda () + (org-bullets-mode 1) + (setq org-pretty-entities t) + (setq org-src-fontify-natively t))) #+end_src +*** Keybindings +#+begin_src emacs-lisp + (define-key org-mode-map (kbd "C-c ,") 'org-insert-structure-template) +#+end_src Enables specific languages for org-babel, so those languages can be used and compiled in code blocks and disable the compilation concirmation. The code afterwords enables proper indentation inside those source blocks. #+begin_src emacs-lisp @@ -207,3 +247,16 @@ (setq org-confirm-babel-evaluate nil) (setq org-src-tab-acts-natively t) #+end_src +** C-Mode + #+begin_src emacs-lisp + (add-hook 'c-mode-hook + (lambda () + (display-line-numbers-mode 1))) + #+end_src + +** C++-Mode + #+begin_src emacs-lisp + (add-hook 'c++-mode-hook + (lambda () + (display-line-numbers-mode 1))) + #+end_src diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el index 806751c..37b20b8 100644 --- a/emacs/.emacs.d/init.el +++ b/emacs/.emacs.d/init.el @@ -1,2 +1,15 @@ (org-babel-load-file "~/.emacs.d/config.org") (put 'upcase-region 'disabled nil) +(custom-set-variables + ;; custom-set-variables was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + '(package-selected-packages + '(go-mode yasnippet use-package theme-magic rainbow-mode rainbow-delimiters ox-twbs ox-reveal ox-hugo org-bullets no-littering moe-theme magit ivy-prescient god-mode evil-collection diminish counsel auctex))) +(custom-set-faces + ;; custom-set-faces was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + ) diff --git a/emacs/.emacs.d/snippets/c++-mode/template b/emacs/.emacs.d/snippets/c++-mode/template new file mode 100644 index 0000000..84c6b01 --- /dev/null +++ b/emacs/.emacs.d/snippets/c++-mode/template @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: template +# key: template +# -- +#include + +int main(int argc, char *argv[]){ + $0 +} \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/c-mode/template b/emacs/.emacs.d/snippets/c-mode/template index 387a78d..f4732c1 100644 --- a/emacs/.emacs.d/snippets/c-mode/template +++ b/emacs/.emacs.d/snippets/c-mode/template @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: template -# key: templat +# key: template # -- #include diff --git a/emacs/.emacs.d/snippets/makefile-mode/template b/emacs/.emacs.d/snippets/makefile-mode/template deleted file mode 100644 index 6bfb295..0000000 --- a/emacs/.emacs.d/snippets/makefile-mode/template +++ /dev/null @@ -1,16 +0,0 @@ -# -*- mode: snippet -*- -# name: template -# key: template -# -- -CC = gcc -CFLAGS = -RM = rm -TARGET = $0 - -all: ${TARGET} - -${TARGET}: ${TARGET}.c - ${CC} ${CFLAGS} -o ${TARGET} ${TARGET}.c - -clean: - ${RM} ${TARGET} \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/makefile-mode/templatec b/emacs/.emacs.d/snippets/makefile-mode/templatec new file mode 100644 index 0000000..98bab57 --- /dev/null +++ b/emacs/.emacs.d/snippets/makefile-mode/templatec @@ -0,0 +1,19 @@ +# -*- mode: snippet -*- +# name: templatec +# key: templatec +# expand-env: ((yas-indent-line 'fixed) (yas-wrap-around-region 'nil)) +# -- +CC = gcc +SRC = \$(wildcard *.c) +OBJ = \$(SRC:.c=.o) +CFLAGS = +RM = rm +TARGET = $1 + +all: \$(TARGET) + +\$(TARGET): \$(OBJ) + \$(CC) \$(CFLAGS) -o \$@ \$^ + +clean: + \$(RM) \$(TARGET) \$(OBJ) \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/makefile-mode/templatecxx b/emacs/.emacs.d/snippets/makefile-mode/templatecxx new file mode 100644 index 0000000..c3afd58 --- /dev/null +++ b/emacs/.emacs.d/snippets/makefile-mode/templatecxx @@ -0,0 +1,19 @@ +# -*- mode: snippet -*- +# name: templatecxx +# key: templatecxx +# expand-env: ((yas-indent-line 'fixed) (yas-wrap-around-region 'nil)) +# -- +CXX = g++ +SRC = \$(wildcard *.cpp) +OBJ = \$(SRC:.cpp=.o) +CFLAGS = +RM = rm +TARGET = $1 + +all: \$(TARGET) + +\$(TARGET): \$(OBJ) + \$(CXX) \$(CFLAGS) -o \$@ \$^ + +clean: + \$(RM) \$(TARGET) \$(OBJ) \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/org-mode/leftarrow b/emacs/.emacs.d/snippets/org-mode/leftarrow new file mode 100644 index 0000000..0765bc9 --- /dev/null +++ b/emacs/.emacs.d/snippets/org-mode/leftarrow @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: leftarrow +# key: <- +# -- +\leftarrow{}$0 \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/org-mode/rightarrow b/emacs/.emacs.d/snippets/org-mode/rightarrow new file mode 100644 index 0000000..9465ca5 --- /dev/null +++ b/emacs/.emacs.d/snippets/org-mode/rightarrow @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: rightarrow +# key: -> +# -- +\rightarrow{}$0 \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/org-mode/template b/emacs/.emacs.d/snippets/org-mode/template index ebef253..72c2e31 100644 --- a/emacs/.emacs.d/snippets/org-mode/template +++ b/emacs/.emacs.d/snippets/org-mode/template @@ -3,4 +3,4 @@ # key: template # -- #+TITLE: $0 -#+SETUPFILE: $HOME/Templates/Org-Mode/setupfile.org \ No newline at end of file +#+SETUPFILE: ~/Templates/Org-Mode/setupfile.org \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/python-mode/template b/emacs/.emacs.d/snippets/python-mode/template new file mode 100644 index 0000000..197cc9b --- /dev/null +++ b/emacs/.emacs.d/snippets/python-mode/template @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: template +# key: template +# -- +if __name__ == '__main__': + $0 \ No newline at end of file diff --git a/zsh/.zshrc b/zsh/.zshrc index 32b9d09..fb5d3eb 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -1,6 +1,6 @@ # Paths export ZSH="$HOME/.oh-my-zsh" -export PATH="$PATH:$HOME/.go/bin:$HOME/.local/bin:$HOME/.cargo/bin:$HOME/.dotnet/tools" +export PATH="$PATH:$HOME/.go/bin:$HOME/.local/bin:$HOME/.cargo/bin:$HOME/.dotnet/tools:$HOME:.scripts/" export DOTNET_CLI_TELEMETRY_OPTOUT=1 export PenTestTools=$HOME/Local/PenTesting/ export CTF=$HOME/Documents/CTF/