diff --git a/config/.config/i3/config b/config/.config/i3/config index a6dced7..573343f 100644 --- a/config/.config/i3/config +++ b/config/.config/i3/config @@ -75,10 +75,8 @@ bindsym $mod+Shift+8 move container to workspace $ws8; workspace $ws8 bindsym $mod+Shift+9 move container to workspace $ws9; workspace $ws9 # Open specific applications in floating mode -for_window [class="Nitrogen"] floating enable sticky enable border normal for_window [class="(?i)virtualbox"] floating enable border normal for_window [title="KeePassX$"] floating enable border normal -for_window [title="Eddie - Settings"] floating enable border normal for_window [class="^Thunderbird$" title="^.*Event:"] floating enable # https://github.com/z3ntu/dotfiles/blob/master/i3/.config/i3/config diff --git a/config/.local/share/ranger/bookmarks b/config/.local/share/ranger/bookmarks index c1cda87..9e6a36d 100644 --- a/config/.local/share/ranger/bookmarks +++ b/config/.local/share/ranger/bookmarks @@ -2,12 +2,12 @@ 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/Uni/Studium/2020&2021 Wintersemseter/Programmierung in C-C++/Exercise/03/tran_3030462_ex03/task01 +a:/home/tuan/.nextcloud/Documents/Uni/Studium/2020&2021 Wintersemseter/Programmierung in C-C++/Exercise/11/tran_3030462_ex11/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/f/b +':/home/tuan/Pictures/Screenshots/2021-03 e:/home/tuan/Documents/CTF/TryHackMe/Ice/2_Recon diff --git a/config/.scripts/project.sh b/config/.scripts/project.sh deleted file mode 100755 index 2854d56..0000000 --- a/config/.scripts/project.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/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 c12658d..64701de 100755 --- a/config/.scripts/screenshot.sh +++ b/config/.scripts/screenshot.sh @@ -5,24 +5,25 @@ type dunstify >/dev/null 2>&1 || { echo >&2 "I require dunstify but it's not ins type xclip >/dev/null 2>&1 || { echo >&2 "I require xclip but it's not installed. Aborting."; exit 1; } 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); +d=$HOME/Pictures/Screenshots/$(date +%Y-%m); fd=$(date +%G-%m-%d_%H-%M-%S) + case $1 in "screen"*) - filename=$fd-$(cat /proc/$(xdotool getwindowpid $(xdotool getwindowfocus))/comm).png; + filename=$fd-$(cat /proc/$(xdotool getwindowfocus getwindowpid)/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=$fd-$(cat /proc/$(xdotool getwindowpid $(xdotool getwindowfocus))/comm).png + filename=$fd-$(cat /proc/$(xdotool getwindowfocus getwindowpid)/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=$fd-$(cat /proc/$(xdotool getwindowpid $(xdotool getwindowfocus))/comm).png; + # dunstify -r 2 'Taking screenshot from area.'; + filename=$fd-$(cat /proc/$(xdotool getwindowfocus getwindowpid)/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/config/.scripts/startup.sh b/config/.scripts/startup.sh index 13defd8..502777f 100755 --- a/config/.scripts/startup.sh +++ b/config/.scripts/startup.sh @@ -25,13 +25,13 @@ function kb_routine { function battery_routine { capacity=$(< /sys/class/power_supply/BAT0/capacity) if [[ $capacity -lt lower_battery_threshold ]]; then - acpi | grep -q 'Discharging' && dunstify "$capacity"; + acpi | grep -q '0: Discharging' && dunstify "Battery at $capacity%"; fi } while : do - kb_routine + # kb_routine battery_routine sleep 1; done diff --git a/config/.ssh/config b/config/.ssh/config index caa3a66..e7cdfe5 100644 --- a/config/.ssh/config +++ b/config/.ssh/config @@ -99,7 +99,7 @@ Host plex User root IdentityFile /mnt/veracrypt1/proxmox -Host plex-00 +Host sshfs HostName 10.1.11.107 Port 22 User root diff --git a/emacs/.emacs.d/config.org b/emacs/.emacs.d/config.org index 80e8160..332a0b8 100644 --- a/emacs/.emacs.d/config.org +++ b/emacs/.emacs.d/config.org @@ -182,30 +182,47 @@ (ansible 1)) #+END_SRC +*** [[https://github.com/flycheck/flycheck-rust][flycheck-rust]] + =Better Rust/Cargo support for Flycheck= + #+BEGIN_SRC emacs-lisp + (use-package flycheck-rust) + #+END_SRC + +*** [[https://github.com/rust-lang/rust-mode][rust-mode]] + =Emacs configuration for Rust= + #+BEGIN_SRC emacs-lisp + (use-package rust-mode) + #+END_SRC + +*** [[https://github.com/kwrooijen/cargo.el][cargo.el]] + #+BEGIN_SRC emacs-lisp + (use-package cargo) + #+END_SRC + * Appearance This section is for appearance customization. Either via packages or manually. -** [[https://github.com/kuanyui/moe-theme.el][moe-theme]] - =A customizable colorful eye-candy theme for Emacser. Moe, moe, kyun!= +** [[https://github.com/balajisivaraman/emacs-one-themes][emacs-one-themes]] + =A port of the Vim/Atom One Dark and Light themes to Emacs= - #+begin_src emacs-lisp - (use-package moe-theme - :config - (moe-dark)) - #+end_src + ##+begin_src emacs-lisp + # (use-package one-themes + # :init + # (load-theme 'one-dark t)) + ##+end_src - -** Transparent Emacs +** Transparent Emacs (Commented out) + #+begin_comment Makes the default color of the background of emacs the same as the terminals color. This is kind of a janky solution, but it works. #+begin_src emacs-lisp - (add-hook 'window-setup-hook - '(lambda () - (if not (display-graphic-p) - (set-face-background 'default "unspecified-bg")))) + (add-hook 'window-setup-hook + '(lambda () + (if not (display-graphic-p) + (set-face-background 'default "unspecified-bg")))) #+end_src - + #+end_comment ** Menubar Remove the menu-bar at the top of the screen for better immersion. @@ -229,7 +246,7 @@ #+END_SRC * Mode Configuration -** Org-Mode +** Org-mode Enable org-bullets and hide leading stars. #+begin_src emacs-lisp @@ -239,6 +256,12 @@ (setq org-pretty-entities t) (setq org-src-fontify-natively t))) #+end_src + + Enable utf8x on latex output + + #+begin_src emacs-lisp + (setq org-latex-inputenc-alist '(("utf8" . "utf8x"))) + #+end_src *** Keybindings #+begin_src emacs-lisp @@ -260,17 +283,28 @@ (setq org-src-tab-acts-natively t) #+end_src -** C-Mode +** C-mode #+begin_src emacs-lisp (add-hook 'c-mode-hook (lambda () (display-line-numbers-mode 1))) #+end_src -** C++-Mode +** C++-mode #+begin_src emacs-lisp (add-hook 'c++-mode-hook (lambda () (display-line-numbers-mode 1))) #+end_src + +** rust-mode + cargo.el + #+begin_src emacs-lisp + (add-hook 'rust-mode-hook 'cargo-minor-mode) + #+end_src + + flycheck-rust + #+begin_src emacs-lisp + (add-hook 'flycheck-mode-hook #'flycheck-rust-setup) + #+end_src diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el index b01f8f8..7ba7294 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. '(auth-source-save-behavior nil) '(package-selected-packages - '(ansible yasnippet use-package theme-magic rainbow-mode rainbow-delimiters ox-twbs ox-reveal ox-hugo org-bullets no-littering moe-theme magit ivy-prescient htmlize god-mode go-mode flycheck evil-collection diminish counsel company auctex))) + '(flycheck-rust ansible yasnippet use-package theme-magic rainbow-mode rainbow-delimiters ox-twbs ox-reveal ox-hugo org-bullets no-littering moe-theme magit ivy-prescient htmlize god-mode go-mode flycheck evil-collection diminish counsel company 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. diff --git a/emacs/.emacs.d/snippets/c++-mode/inline_comment b/emacs/.emacs.d/snippets/c++-mode/inline_comment new file mode 100644 index 0000000..f7a1f08 --- /dev/null +++ b/emacs/.emacs.d/snippets/c++-mode/inline_comment @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: inline comment template +# key: /*! +# -- +/*!< $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 84c6b01..a717c37 100644 --- a/emacs/.emacs.d/snippets/c++-mode/template +++ b/emacs/.emacs.d/snippets/c++-mode/template @@ -2,8 +2,13 @@ # name: template # key: template # -- -#include +#include +/** + @brief + + @result +*/ int main(int argc, char *argv[]){ $0 } \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/c-mode/fun_comment b/emacs/.emacs.d/snippets/c-mode/fun_comment new file mode 100644 index 0000000..4fa396e --- /dev/null +++ b/emacs/.emacs.d/snippets/c-mode/fun_comment @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: function template +# key: /** +# -- +/** + @brief $0 + + @param[in] + @result + */ \ 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 f4732c1..e057b7e 100644 --- a/emacs/.emacs.d/snippets/c-mode/template +++ b/emacs/.emacs.d/snippets/c-mode/template @@ -4,6 +4,11 @@ # -- #include +/** + @brief + + @result +*/ int main(int argc, char *argv[]){ $0 } \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/makefile-mode/templatec b/emacs/.emacs.d/snippets/makefile-mode/templatec index 98bab57..c95704e 100644 --- a/emacs/.emacs.d/snippets/makefile-mode/templatec +++ b/emacs/.emacs.d/snippets/makefile-mode/templatec @@ -4,10 +4,10 @@ # expand-env: ((yas-indent-line 'fixed) (yas-wrap-around-region 'nil)) # -- CC = gcc -SRC = \$(wildcard *.c) +SRC = \$(wildcard src/*.c) OBJ = \$(SRC:.c=.o) CFLAGS = -RM = rm +RM = rm -f TARGET = $1 all: \$(TARGET) diff --git a/emacs/.emacs.d/snippets/makefile-mode/templatecxx b/emacs/.emacs.d/snippets/makefile-mode/templatecxx index c3afd58..5aafc84 100644 --- a/emacs/.emacs.d/snippets/makefile-mode/templatecxx +++ b/emacs/.emacs.d/snippets/makefile-mode/templatecxx @@ -4,16 +4,16 @@ # expand-env: ((yas-indent-line 'fixed) (yas-wrap-around-region 'nil)) # -- CXX = g++ -SRC = \$(wildcard *.cpp) +SRC = \$(wildcard src/*.cpp) OBJ = \$(SRC:.cpp=.o) -CFLAGS = -RM = rm +CXXFLAGS = --std=c++11 +RM = rm -f TARGET = $1 all: \$(TARGET) \$(TARGET): \$(OBJ) - \$(CXX) \$(CFLAGS) -o \$@ \$^ + \$(CXX) \$(CXXFLAGS) -o \$@ \$^ clean: \$(RM) \$(TARGET) \$(OBJ) \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/org-mode/righttack b/emacs/.emacs.d/snippets/org-mode/righttack new file mode 100644 index 0000000..9c448d1 --- /dev/null +++ b/emacs/.emacs.d/snippets/org-mode/righttack @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: righttack +# key: |- +# -- +⊢$0 \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/rust-mode/println b/emacs/.emacs.d/snippets/rust-mode/println new file mode 100644 index 0000000..80bac46 --- /dev/null +++ b/emacs/.emacs.d/snippets/rust-mode/println @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: println! +# key: println +# -- +println!("$0"); \ No newline at end of file