diff options
| author | yuzu-eva <stevenhu@web.de> | 2022-12-07 12:48:11 +0100 |
|---|---|---|
| committer | yuzu-eva <stevenhu@web.de> | 2022-12-07 12:48:11 +0100 |
| commit | cae62a4c0bc3e09c5d74124d160d0f02bf8cf4fb (patch) | |
| tree | 37e61b1cf05c40943d7766e0eb725a9a9eae48f6 | |
| parent | 96c8d201349fe8b41ca6bfc38317a42169e07cb7 (diff) | |
added files
| -rw-r--r-- | .bash_aliases | 131 | ||||
| -rw-r--r-- | .config/compton/compton.conf | 7 | ||||
| -rw-r--r-- | .config/dunst/dunstrc | 457 | ||||
| -rwxr-xr-x | .config/yt-dlp/config | 1 | ||||
| -rw-r--r-- | .emacs.d/config.el | 74 | ||||
| -rw-r--r-- | .emacs.d/dracula-custom-theme.el | 52 | ||||
| -rw-r--r-- | .emacs.d/functions.el | 49 | ||||
| -rw-r--r-- | .emacs.d/init.el | 14 | ||||
| -rw-r--r-- | .emacs.d/keybinds.el | 14 | ||||
| -rw-r--r-- | .emacs.d/packages.el | 330 |
10 files changed, 1129 insertions, 0 deletions
diff --git a/.bash_aliases b/.bash_aliases new file mode 100644 index 0000000..99c8c66 --- /dev/null +++ b/.bash_aliases @@ -0,0 +1,131 @@ +# __ _ _ +# ___ __ _ / _| ___| |__ __ _| |__ ___ +# / __/ _` | |_ / _ \ '_ \ / _` | '_ \ / _ \ +# | (_| (_| | _| __/ |_) | (_| | |_) | __/ +# \___\__,_|_| \___|_.__/ \__,_|_.__/ \___| +# + +################# +# Miscellaneous # +################# + +alias refresh='source ~/.bashrc' +alias fuck='sudo $(history -p !!)' +alias open='xdg-open' +alias rsync='rsync -avh --progress' +alias cwp='xwallpaper --maximize "$(/usr/bin/ls -1 -d /hdd/Pictures/wallpaper/* | shuf -n1)"' +alias fd='fdfind' + +# Control Audio +alias headset='pactl set-default-sink alsa_output.pci-0000_29_00.0.analog-stereo' +alias speakers='pactl set-default-sink alsa_output.pci-0000_31_00.4.analog-stereo' +alias setvol='pactl set-sink-volume @DEFAULT_SINK@' + +# Monitor / Resolution settings, mainly for playing old-ass games +alias setlmon-lowres='xrandr --auto --output HDMI-A-0 --mode 640x480 --primary' +alias setlmon-midres='xrandr --auto --output HDMI-A-0 --mode 800x600 --primary' +alias setlmon-default='xrandr --auto --output HDMI-A-0 --mode 1920x1080 --primary' +alias setrmon-lowres='xrandr --auto --output DisplayPort-2 --mode 640x480 --left-of HDMI-A-0' +alias setrmon-midres='xrandr --auto --output DisplayPort-2 --mode 800x600 --left-of HDMI-A-0' +alias setrmon-default='xrandr --auto --output DisplayPort-2 --mode 1600x900 --left-of HDMI-A-0' + +# Set Neofetch ASCII +alias neofetch='neofetch --source ~/Documents/ascii-art/lain-ascii.txt' +alias cn='clear;neofetch' + +# Colorize grep output +alias grep='grep --color=auto -i' + +alias ls='ls -hl --color=always --group-directories-first' + +alias nnn='nnn -Hde' + +# Convert date from YYYYMMDD to YYYY-MM-DD +date-convert() { + for i in *; do + mv "${i}" "$(echo "${i}" | + sed 's/\([0-9][0-9][0-9][0-9]\)\([0-9][0-9]\)\([0-9][0-9]\)/\1-\2-\3/')" + done; +} + +# Reverse date from DD-MM-YYYY to YYYY-MM-DD +date-reverse() { + for i in *; do + mv "${i}" "$(echo "${i}" | + sed 's/\([0-9][0-9]\)-\([0-9][0-9]\)-\([0-9][0-9][0-9][0-9]\)/\3-\1-\2/')" + done; +} + +# Convert video files to webm +mkwebm() { + ffmpeg -i "${1}" -crf 1 -b:v 1M -c:a libvorbis "${1%.*}".webm +} + +# record primary monitor with audio output and input +record() { + ffmpeg -s 1920x1080 \ + -framerate 60 -f x11grab -i :0.0+1600 \ + -f pulse -ac 2 -ar 44100 -i alsa_output.pci-0000_29_00.0.analog-stereo.monitor \ + -f pulse -ac 1 -ar 44100 -i alsa_input.usb-SunplusIT_Inc_FHD_Camera_Microphone_01.00.00-02.analog-stereo \ + -filter_complex amix=inputs=2 \ + -vcodec libx265 -s 1920x1080 \ + -acodec libvorbis -ab 128k \ + $HOME/vids/$1.mkv +} + +####### +# git # +####### + +alias commit='git commit -m' +alias fetch='git fetch' +alias upstream='git push --set-upstream origin' +alias remote='git remote add origin' +alias pull='git pull origin' +alias push='git push origin' + +# Shortcut for dotfiles repo +alias dfiles='/usr/bin/git --git-dir=$HOME/dotfiles --work-tree=$HOME' + +################### +# Package Manager # +################### + +alias aptin='sudo apt install' +alias aptup='sudo apt update && sudo apt upgrade' +alias aptupd='sudo apt update' +alias aptupg='sudo apt upgrade' +alias aptrm='sudo apt remove' +alias aptsr='apt search' +alias listup='apt list --upgradeable' +alias listin='apt list --installed' + +########## +# yt-dlp # +########## + +alias ytvid='yt-dlp -o "/hdd/Videos/Archives/random/%(title)s.%(ext)s" --remux-video "mkv"' +alias ytarchive='yt-dlp --write-description --write-info-json --write-thumbnail --write-sub \ + -o "/hdd/Videos/Archives/%(uploader)s/%(upload_date)s - %(title)s/%(title)s.%(ext)s" --remux-video "mkv"' + +# Function to specify filename, so I can avoid total chaos in my library +ytmp3() { + read -p "Enter filename: " name; + read -p "Enter link: " link; + yt-dlp -x --audio-format mp3 --download-archive "/hdd/Music/Archive_goodMusic.txt" \ + --embed-metadata -o "/hdd/Music/Youtube Downloads/$name.%(ext)s" $link +} + +########### +# Network # +########### + +alias flush-dns='sudo /etc/init.d/dns-clean start' + +############# +# Shortcuts # +############# + +alias jpwine='LANG=ja_JP.UTF-8 WINEDEBUG=-all wine' +alias vi='nvim' +alias emacs='emacsclient -c -a "emacs"' diff --git a/.config/compton/compton.conf b/.config/compton/compton.conf new file mode 100644 index 0000000..77b6cb3 --- /dev/null +++ b/.config/compton/compton.conf @@ -0,0 +1,7 @@ +# Opacity +opacity-rule = [ + "80:class_g = 'kitty' && focused", + "80:class_g = 'kitty' && !focused", + "80:class_g = 'st-256color' && focused", + "80:class_g = 'st-256color' && !focused" +]; diff --git a/.config/dunst/dunstrc b/.config/dunst/dunstrc new file mode 100644 index 0000000..60a12e6 --- /dev/null +++ b/.config/dunst/dunstrc @@ -0,0 +1,457 @@ +# See dunst(5) for all configuration options + +[global] + ### Display ### + + # Which monitor should the notifications be displayed on. + monitor = 0 + + # Display notification on focused monitor. Possible modes are: + # mouse: follow mouse pointer + # keyboard: follow window with keyboard focus + # none: don't follow anything + # + # "keyboard" needs a window manager that exports the + # _NET_ACTIVE_WINDOW property. + # This should be the case for almost all modern window managers. + # + # If this option is set to mouse or keyboard, the monitor option + # will be ignored. + follow = none + + ### Geometry ### + + # dynamic width from 0 to 300 + # width = (0, 300) + # constant width of 300 + width = 300 + + # The maximum height of a single notification, excluding the frame. + height = 300 + + # Position the notification in the top right corner + origin = top-right + + # Offset from the origin + offset = 10x50 + + # Scale factor. It is auto-detected if value is 0. + scale = 0 + + # Maximum number of notification (0 means no limit) + notification_limit = 0 + + ### Progress bar ### + + # Turn on the progess bar. It appears when a progress hint is passed with + # for example dunstify -h int:value:12 + progress_bar = true + + # Set the progress bar height. This includes the frame, so make sure + # it's at least twice as big as the frame width. + progress_bar_height = 10 + + # Set the frame width of the progress bar + progress_bar_frame_width = 1 + + # Set the minimum width for the progress bar + progress_bar_min_width = 150 + + # Set the maximum width for the progress bar + progress_bar_max_width = 300 + + + # Show how many messages are currently hidden (because of + # notification_limit). + indicate_hidden = yes + + # The transparency of the window. Range: [0; 100]. + # This option will only work if a compositing window manager is + # present (e.g. xcompmgr, compiz, etc.). (X11 only) + transparency = 0 + + # Draw a line of "separator_height" pixel height between two + # notifications. + # Set to 0 to disable. + # If gap_size is greater than 0, this setting will be ignored. + separator_height = 2 + + # Padding between text and separator. + padding = 8 + + # Horizontal padding. + horizontal_padding = 8 + + # Padding between text and icon. + text_icon_padding = 0 + + # Defines width in pixels of frame around the notification window. + # Set to 0 to disable. + frame_width = 3 + + # Defines color of the frame around the notification window. + frame_color = "#aaaaaa" + + # Size of gap to display between notifications - requires a compositor. + # If value is greater than 0, separator_height will be ignored and a border + # of size frame_width will be drawn around each notification instead. + # Click events on gaps do not currently propagate to applications below. + gap_size = 0 + + # Define a color for the separator. + # possible values are: + # * auto: dunst tries to find a color fitting to the background; + # * foreground: use the same color as the foreground; + # * frame: use the same color as the frame; + # * anything else will be interpreted as a X color. + separator_color = frame + + # Sort messages by urgency. + sort = yes + + # Don't remove messages, if the user is idle (no mouse or keyboard input) + # for longer than idle_threshold seconds. + # Set to 0 to disable. + # A client can set the 'transient' hint to bypass this. See the rules + # section for how to disable this if necessary + # idle_threshold = 120 + + ### Text ### + + font = Monospace 8 + + # The spacing between lines. If the height is smaller than the + # font height, it will get raised to the font height. + line_height = 0 + + # Possible values are: + # full: Allow a small subset of html markup in notifications: + # <b>bold</b> + # <i>italic</i> + # <s>strikethrough</s> + # <u>underline</u> + # + # For a complete reference see + # <https://docs.gtk.org/Pango/pango_markup.html>. + # + # strip: This setting is provided for compatibility with some broken + # clients that send markup even though it's not enabled on the + # server. Dunst will try to strip the markup but the parsing is + # simplistic so using this option outside of matching rules for + # specific applications *IS GREATLY DISCOURAGED*. + # + # no: Disable markup parsing, incoming notifications will be treated as + # plain text. Dunst will not advertise that it has the body-markup + # capability if this is set as a global setting. + # + # It's important to note that markup inside the format option will be parsed + # regardless of what this is set to. + markup = full + + # The format of the message. Possible variables are: + # %a appname + # %s summary + # %b body + # %i iconname (including its path) + # %I iconname (without its path) + # %p progress value if set ([ 0%] to [100%]) or nothing + # %n progress value if set without any extra characters + # %% Literal % + # Markup is allowed + format = "<b>%s</b>\n%b" + + # Alignment of message text. + # Possible values are "left", "center" and "right". + alignment = left + + # Vertical alignment of message text and icon. + # Possible values are "top", "center" and "bottom". + vertical_alignment = center + + # Show age of message if message is older than show_age_threshold + # seconds. + # Set to -1 to disable. + show_age_threshold = 60 + + # Specify where to make an ellipsis in long lines. + # Possible values are "start", "middle" and "end". + ellipsize = middle + + # Ignore newlines '\n' in notifications. + ignore_newline = no + + # Stack together notifications with the same content + stack_duplicates = true + + # Hide the count of stacked notifications with the same content + hide_duplicate_count = false + + # Display indicators for URLs (U) and actions (A). + show_indicators = yes + + ### Icons ### + + # Recursive icon lookup. You can set a single theme, instead of having to + # define all lookup paths. + enable_recursive_icon_lookup = true + + # Set icon theme (only used for recursive icon lookup) + icon_theme = Adwaita + # You can also set multiple icon themes, with the leftmost one being used first. + # icon_theme = "Adwaita, breeze" + + # Align icons left/right/top/off + icon_position = left + + # Scale small icons up to this size, set to 0 to disable. Helpful + # for e.g. small files or high-dpi screens. In case of conflict, + # max_icon_size takes precedence over this. + min_icon_size = 32 + + # Scale larger icons down to this size, set to 0 to disable + max_icon_size = 128 + + # Paths to default icons (only neccesary when not using recursive icon lookup) + icon_path = /usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/ + + ### History ### + + # Should a notification popped up from history be sticky or timeout + # as if it would normally do. + sticky_history = yes + + # Maximum amount of notifications kept in history + history_length = 20 + + ### Misc/Advanced ### + + # dmenu path. + dmenu = /usr/local/bin/dmenu -p dunst: + + # Browser for opening urls in context menu. + browser = /usr/bin/firefox + + # Context menu + context = ctrl+shift+period + + # Always run rule-defined scripts, even if the notification is suppressed + always_run_script = true + + # Define the title of the windows spawned by dunst + title = Dunst + + # Define the class of the windows spawned by dunst + class = Dunst + + # Define the corner radius of the notification window + # in pixel size. If the radius is 0, you have no rounded + # corners. + # The radius will be automatically lowered if it exceeds half of the + # notification height to avoid clipping text and/or icons. + corner_radius = 0 + + # Ignore the dbus closeNotification message. + # Useful to enforce the timeout set by dunst configuration. Without this + # parameter, an application may close the notification sent before the + # user defined timeout. + ignore_dbusclose = false + + ### Wayland ### + # These settings are Wayland-specific. They have no effect when using X11 + + # Uncomment this if you want to let notications appear under fullscreen + # applications (default: overlay) + # layer = top + + # Set this to true to use X11 output on Wayland. + force_xwayland = false + + ### Legacy + + # Use the Xinerama extension instead of RandR for multi-monitor support. + # This setting is provided for compatibility with older nVidia drivers that + # do not support RandR and using it on systems that support RandR is highly + # discouraged. + # + # By enabling this setting dunst will not be able to detect when a monitor + # is connected or disconnected which might break follow mode if the screen + # layout changes. + force_xinerama = false + + ### mouse + + # Defines list of actions for each mouse event + # Possible values are: + # * none: Don't do anything. + # * do_action: Invoke the action determined by the action_name rule. If there is no + # such action, open the context menu. + # * open_url: If the notification has exactly one url, open it. If there are multiple + # ones, open the context menu. + # * close_current: Close current notification. + # * close_all: Close all notifications. + # * context: Open context menu for the notification. + # * context_all: Open context menu for all notifications. + # These values can be strung together for each mouse event, and + # will be executed in sequence. + mouse_left_click = close_current + mouse_middle_click = open_url + mouse_right_click = close_all + +# Experimental features that may or may not work correctly. Do not expect them +# to have a consistent behaviour across releases. +[experimental] + # Calculate the dpi to use on a per-monitor basis. + # If this setting is enabled the Xft.dpi value will be ignored and instead + # dunst will attempt to calculate an appropriate dpi value for each monitor + # using the resolution and physical size. This might be useful in setups + # where there are multiple screens with very different dpi values. + per_monitor_dpi = false + + +[urgency_low] + # IMPORTANT: colors have to be defined in quotation marks. + # Otherwise the "#" and following would be interpreted as a comment. + background = "#222222" + foreground = "#888888" + timeout = 10 + # Icon for notifications with low urgency, uncomment to enable + #default_icon = /path/to/icon + +[urgency_normal] + background = "#285577" + foreground = "#ffffff" + timeout = 10 + # Icon for notifications with normal urgency, uncomment to enable + #default_icon = /path/to/icon + +[urgency_critical] + background = "#900000" + foreground = "#ffffff" + frame_color = "#ff0000" + timeout = 0 + # Icon for notifications with critical urgency, uncomment to enable + #default_icon = /path/to/icon + +# Every section that isn't one of the above is interpreted as a rules to +# override settings for certain messages. +# +# Messages can be matched by +# appname (discouraged, see desktop_entry) +# body +# category +# desktop_entry +# icon +# match_transient +# msg_urgency +# stack_tag +# summary +# +# and you can override the +# background +# foreground +# format +# frame_color +# fullscreen +# new_icon +# set_stack_tag +# set_transient +# set_category +# timeout +# urgency +# icon_position +# skip_display +# history_ignore +# action_name +# word_wrap +# ellipsize +# alignment +# hide_text +# +# Shell-like globbing will get expanded. +# +# Instead of the appname filter, it's recommended to use the desktop_entry filter. +# GLib based applications export their desktop-entry name. In comparison to the appname, +# the desktop-entry won't get localized. +# +# SCRIPTING +# You can specify a script that gets run when the rule matches by +# setting the "script" option. +# The script will be called as follows: +# script appname summary body icon urgency +# where urgency can be "LOW", "NORMAL" or "CRITICAL". +# +# NOTE: It might be helpful to run dunst -print in a terminal in order +# to find fitting options for rules. + +# Disable the transient hint so that idle_threshold cannot be bypassed from the +# client +#[transient_disable] +# match_transient = yes +# set_transient = no +# +# Make the handling of transient notifications more strict by making them not +# be placed in history. +#[transient_history_ignore] +# match_transient = yes +# history_ignore = yes + +# fullscreen values +# show: show the notifications, regardless if there is a fullscreen window opened +# delay: displays the new notification, if there is no fullscreen window active +# If the notification is already drawn, it won't get undrawn. +# pushback: same as delay, but when switching into fullscreen, the notification will get +# withdrawn from screen again and will get delayed like a new notification +#[fullscreen_delay_everything] +# fullscreen = delay +#[fullscreen_show_critical] +# msg_urgency = critical +# fullscreen = show + +#[espeak] +# summary = "*" +# script = dunst_espeak.sh + +#[script-test] +# summary = "*script*" +# script = dunst_test.sh + +#[ignore] +# # This notification will not be displayed +# summary = "foobar" +# skip_display = true + +#[history-ignore] +# # This notification will not be saved in history +# summary = "foobar" +# history_ignore = yes + +#[skip-display] +# # This notification will not be displayed, but will be included in the history +# summary = "foobar" +# skip_display = yes + +#[signed_on] +# appname = Pidgin +# summary = "*signed on*" +# urgency = low +# +#[signed_off] +# appname = Pidgin +# summary = *signed off* +# urgency = low +# +#[says] +# appname = Pidgin +# summary = *says* +# urgency = critical +# +#[twitter] +# appname = Pidgin +# summary = *twitter.com* +# urgency = normal +# +#[stack-volumes] +# appname = "some_volume_notifiers" +# set_stack_tag = "volume" +# +# vim: ft=cfg diff --git a/.config/yt-dlp/config b/.config/yt-dlp/config new file mode 100755 index 0000000..aeb3bda --- /dev/null +++ b/.config/yt-dlp/config @@ -0,0 +1 @@ +--verbose -ciw -f bestvideo[ext=mp4][vcodec!*=av01]+bestaudio[ext=m4a]/best[ext=mp4]/best --merge-output-format mkv diff --git a/.emacs.d/config.el b/.emacs.d/config.el new file mode 100644 index 0000000..5e57a07 --- /dev/null +++ b/.emacs.d/config.el @@ -0,0 +1,74 @@ +(add-hook 'text-mode-hook 'display-line-numbers-mode) +(add-hook 'prog-mode-hook 'display-line-numbers-mode) +(add-hook 'emacs-startup-hook 'startup/revert-file-name-handler-alist) +(add-hook 'emacs-startup-hook 'startup/reset-gc) + +(show-paren-mode 1) +(tool-bar-mode -1) +(menu-bar-mode -1) +(scroll-bar-mode -1) +(global-prettify-symbols-mode t) +(electric-pair-mode t) +(global-hl-line-mode t) +(recentf-mode 1) +(savehist-mode 1) +(global-auto-revert-mode 1) + +(set-frame-parameter (selected-frame) 'alpha '(80 . 80)) +(add-to-list 'default-frame-alist '(alpha .(80 . 80))) + +(defvar startup/file-name-handler-alist file-name-handler-alist) + +(defalias 'open 'find-file-other-window) +(defalias 'clean 'eshell/clear-scrollback) +(defalias 'yes-or-no-p 'y-or-n-p) + +;; Make emacs startup faster +(setq gc-cons-threshold 402653184 + gc-cons-percentage 0.6) + +(setq-default major-mode 'text-mode) + +(setq inhibit-startup-message t) +(setq x-select-enable-clipboard t) +(setq make-backup-files nil) +(setq scroll-conservatively 100) +(setq ring-bell-function 'ignore) +(setq history-length 25) +(setq global-auto-revert-non-file-buffers t) + +(setq-default tab-width 4) +(setq-default standard-indent 4) +(setq c-basic-offset tab-width) +(setq-default electric-indent-inhibit t) +(setq-default indent-tabs-mode t) +(setq backward-delete-char-untabify-method 'nil) + + +(setq electric-pair-pairs '( + (?\{ . ?\}) + (?\( . ?\)) + (?\[ . ?\]) + (?\" . ?\") + )) + +(setq use-package-always-defer t) + +(setq eshell-prompt-regexp "^[^αλ\n]*[αλ] ") +(setq eshell-prompt-function + (lambda nil + (concat + (if (string= (eshell/pwd) (getenv "HOME")) + (propertize "~" 'face `(:foreground "#99CCFF")) + (replace-regexp-in-string + (getenv "HOME") + (propertize "~" 'face `(:foreground "#99CCFF")) + (propertize (eshell/pwd) 'face `(:foreground "#99CCFF")))) + (if (= (user-uid) 0) + (propertize " α " 'face `(:foreground "#FF6666")) + (propertize " λ " 'face `(:foreground "#A6E22E")))))) + +(setq eshell-highlight-prompt nil) +(setq file-name-handler-alist nil) + +(setq initial-buffer-choice (lambda () (get-buffer "*dashboard*"))) diff --git a/.emacs.d/dracula-custom-theme.el b/.emacs.d/dracula-custom-theme.el new file mode 100644 index 0000000..6f1d11b --- /dev/null +++ b/.emacs.d/dracula-custom-theme.el @@ -0,0 +1,52 @@ +(deftheme dracula-custom + "Created 2022-11-27.") + +(custom-theme-set-faces + 'dracula-custom + '(default ((t (:family "Hack Nerd Font" :foundry "SRC" :width normal :height 113 :weight normal :slant normal :underline nil :overline nil :extend nil :strike-through nil :box nil :inverse-video nil :foreground "#F8F8F2" :background "#262626" :stipple nil :inherit nil)))) + '(cursor ((t (:background "#ccccc7")))) + '(fixed-pitch ((t (:family "Monospace")))) + '(variable-pitch ((((type w32)) (:foundry "outline" :family "Arial")) (t (:family "Sans Serif")))) + '(escape-glyph ((((background dark)) (:foreground "cyan")) (((type pc)) (:foreground "magenta")) (t (:foreground "brown")))) + '(homoglyph ((((background dark)) (:foreground "cyan")) (((type pc)) (:foreground "magenta")) (t (:foreground "brown")))) + '(minibuffer-prompt ((t (:weight bold :foreground "#ff79c6")))) + '(highlight ((t (:foreground "#ccccc7" :background "#464752")))) + '(region ((t (:extend t :inherit (match))))) + '(shadow ((t (:foreground "#6272a4")))) + '(secondary-selection ((((class color) (min-colors 88) (background light)) (:extend t :background "yellow1")) (((class color) (min-colors 88) (background dark)) (:extend t :background "SkyBlue4")) (((class color) (min-colors 16) (background light)) (:extend t :background "yellow")) (((class color) (min-colors 16) (background dark)) (:extend t :background "SkyBlue4")) (((class color) (min-colors 8)) (:extend t :foreground "black" :background "cyan")) (t (:inverse-video t)))) + '(trailing-whitespace ((t (:background "#ffb86c")))) + '(font-lock-builtin-face ((t (:slant italic :foreground "#8be9fd")))) + '(font-lock-comment-delimiter-face ((t (:inherit (shadow))))) + '(font-lock-comment-face ((t (:inherit (shadow))))) + '(font-lock-constant-face ((t (:foreground "#bd93f9")))) + '(font-lock-doc-face ((t (:foreground "#6272a4")))) + '(font-lock-doc-markup-face ((t (:inherit (font-lock-constant-face))))) + '(font-lock-function-name-face ((t (:weight bold :foreground "#50fa7b")))) + '(font-lock-keyword-face ((t (:foreground "#ff79c6" :weight bold)))) + '(font-lock-negation-char-face ((t (:foreground "#8be9fd")))) + '(font-lock-preprocessor-face ((t (:foreground "#ffb86c")))) + '(font-lock-regexp-grouping-backslash ((t (:foreground "#8be9fd")))) + '(font-lock-regexp-grouping-construct ((t (:foreground "#bd93f9")))) + '(font-lock-string-face ((t (:foreground "#f1fa8c")))) + '(font-lock-type-face ((t (:inherit (font-lock-builtin-face))))) + '(font-lock-variable-name-face ((t (:foreground "#d8a5f8" :weight bold)))) + '(font-lock-warning-face ((t (:background "#373844" :inherit (warning))))) + '(button ((t (:inherit (link))))) + '(link ((t (:underline (:color foreground-color :style line) :foreground "#8be9fd")))) + '(link-visited ((default (:inherit (link))) (((class color) (background light)) (:foreground "magenta4")) (((class color) (background dark)) (:foreground "violet")))) + '(fringe ((t (:foreground "#b6b6b2" :background "#282a36")))) + '(header-line ((t (:inherit 'mode-line)))) + '(tooltip ((t (:foreground "#f8f8f2" :background "#44475a")))) + '(mode-line ((t (:box (:line-width (1 . 1) :color "#44475a" :style nil) :inverse-video nil :foreground "#f8f8f2" :background "#44475a")))) + '(mode-line-buffer-id ((t (:weight bold)))) + '(mode-line-emphasis ((t (:weight bold)))) + '(mode-line-highlight ((((supports :box t) (class color) (min-colors 88)) (:box (:line-width (2 . 2) :color "grey40" :style released-button))) (t (:inherit (highlight))))) + '(mode-line-inactive ((t (:box (:line-width (1 . 1) :color "#373844" :style nil) :inverse-video nil :foreground "#b6b6b2" :background "#282a36")))) + '(isearch ((t (:weight bold :inherit (match))))) + '(isearch-fail ((t (:foreground "#282a36" :background "#ffb86c")))) + '(lazy-highlight ((t (:foreground "#e2e2dc" :background "#373844")))) + '(match ((t (:foreground "#282a36" :background "#f1fa8c")))) + '(next-error ((t (:inherit (region))))) + '(query-replace ((t (:inherit (isearch)))))) + +(provide-theme 'dracula-custom) diff --git a/.emacs.d/functions.el b/.emacs.d/functions.el new file mode 100644 index 0000000..cc86002 --- /dev/null +++ b/.emacs.d/functions.el @@ -0,0 +1,49 @@ +(defun startup/revert-file-name-handler-alist () + (setq file-name-handler-alist startup/file-name-handler-alist)) + +(defun startup/reset-gc () + (setq gc-cons-threshold 16777216 + gc-cons-percentage 0.1)) + +(defun split-and-follow-horizontally () + (interactive) + (split-window-below) + (balance-windows) + (other-window 1)) + +(defun split-and-follow-vertically () + (interactive) + (split-window-right) + (balance-windows) + (other-window 1)) + +(defun toggle-transparency() + (interactive) + (let ((alpha (frame-parameter nil 'alpha))) + (set-frame-parameter + nil 'alpha + (if (eql (cond ((numberp alpha) alpha) + ((numberp (cdr alpha)) (cdr alpha)) + ;; Also handle undocumented (<active> <inactive>) form. + ((numberp (cadr alpha)) (cadr alpha))) + 100) + '(80 . 80) '(100 . 100))))) + +(defun eshell/sudo-open (filename) + "Open a file as root in Eshell." + (let ((qual-filename (if (string-match "^/" filename) + filename + (concat (expand-file-name (eshell/pwd)) "/" filename)))) + (switch-to-buffer + (find-file-noselect + (concat "/sudo::" qual-filename))))) + +(defun eshell-other-window () + "Create or visit an eshell buffer." + (interactive) + (if (not (get-buffer "*eshell*")) + (progn + (split-window-sensibly (selected-window)) + (other-window 1) + (eshell)) + (switch-to-buffer-other-window "*eshell*"))) diff --git a/.emacs.d/init.el b/.emacs.d/init.el new file mode 100644 index 0000000..6079b3d --- /dev/null +++ b/.emacs.d/init.el @@ -0,0 +1,14 @@ +(load "~/.emacs.d/packages" nil t) +(load "~/.emacs.d/functions" nil t) +(load "~/.emacs.d/keybinds" nil t) +(load "~/.emacs.d/config" nil t) + +(server-start) +(set-default-file-modes #o700) + +;; Load Witchmacs theme +(load-theme 'Witchmacs t) + +;; Move customization variables to a separate file and load it +(setq custom-file (locate-user-emacs-file "custom-vars.el")) +(load custom-file 'noerror 'nomessage) diff --git a/.emacs.d/keybinds.el b/.emacs.d/keybinds.el new file mode 100644 index 0000000..e0fa2ed --- /dev/null +++ b/.emacs.d/keybinds.el @@ -0,0 +1,14 @@ +;; Control X +(global-set-key (kbd "C-x 2") 'split-and-follow-horizontally) +(global-set-key (kbd "C-x 3") 'split-and-follow-vertically) + +;; Super +(global-set-key (kbd "s-C-<left>") 'shrink-window-horizontally) +(global-set-key (kbd "s-C-<right>") 'enlarge-window-horizontally) +(global-set-key (kbd "s-C-<down>") 'shrink-window) +(global-set-key (kbd "s-C-<up>") 'enlarge-window) +(global-set-key (kbd "<s-C-return>") 'eshell-other-window) + +;; Control C +(global-set-key (kbd "C-c r") 'recentf-open-files) +(global-set-key (kbd "C-c t") 'toggle-transparency) diff --git a/.emacs.d/packages.el b/.emacs.d/packages.el new file mode 100644 index 0000000..3e84067 --- /dev/null +++ b/.emacs.d/packages.el @@ -0,0 +1,330 @@ +;; Initialize melpa repo +(require 'package) +(setq package-enable-at-startup nil) +(add-to-list 'package-archives + '("melpa" . "https://melpa.org/packages/")) +(package-initialize) + +;; Initialize use-package +(unless (package-installed-p 'use-package) + (package-refresh-contents) + (package-install 'use-package)) +(use-package org + :config + (add-hook 'org-mode-hook 'org-indent-mode) + (add-hook 'org-mode-hook + '(lambda () + (visual-line-mode 1)))) + +(use-package org-indent + :diminish org-indent-mode) + +(use-package htmlize + :ensure t) + +(use-package auto-package-update + :defer nil + :ensure t + :config + (setq auto-package-update-delete-old-versions t) + (setq auto-package-update-hide-results t) + (auto-package-update-maybe)) + +(use-package diminish + :ensure t) + +(use-package spaceline + :ensure t) + +(use-package powerline + :ensure t + :init + (spaceline-spacemacs-theme) + :hook + ('after-init-hook) . 'powerline-reset) + +(use-package dashboard + :ensure t + :defer nil + :preface + (defun update-config () + "Update Witchmacs to the latest version." + (interactive) + (let ((dir (expand-file-name user-emacs-directory))) + (if (file-exists-p dir) + (progn + (message "Witchmacs is updating!") + (cd dir) + (shell-command "git pull") + (message "Update finished. Switch to the messages buffer to see changes and then restart Emacs")) + (message "\"%s\" doesn't exist." dir)))) + + (defun create-scratch-buffer () + "Create a scratch buffer" + (interactive) + (switch-to-buffer (get-buffer-create "*scratch*")) + (lisp-interaction-mode)) + :config + (dashboard-setup-startup-hook) + (setq dashboard-items '((recents . 5))) + (setq dashboard-banner-logo-title "W I T C H M A C S - The cutest Emacs distribution!") + (setq dashboard-startup-banner "~/.emacs.d/marivector.png") + (setq dashboard-center-content t) + (setq dashboard-show-shortcuts nil) + (setq dashboard-set-init-info t) + (setq dashboard-init-info (format "%d packages loaded in %s" + (length package-activated-list) (emacs-init-time))) + (setq dashboard-set-footer nil) + (setq dashboard-set-navigator t) + (setq dashboard-navigator-buttons + `(;; line1 + ((,nil + "Witchmacs on github" + "Open Witchmacs' github page on your browser" + (lambda (&rest _) (browse-url "https://github.com/snackon/witchmacs")) + 'default) + (nil + "Witchmacs crash course" + "Open Witchmacs' introduction to Emacs" + (lambda (&rest _) (find-file "~/.emacs.d/Witcheat.org")) + 'default) + (nil + "Update Witchmacs" + "Get the latest Witchmacs update. Check out the github commits for changes!" + (lambda (&rest _) (update-config)) + 'default) + ) + ;; line 2 + ((,nil + "Open scratch buffer" + "Switch to the scratch buffer" + (lambda (&rest _) (create-scratch-buffer)) + 'default) + (nil + "Open config.el" + "Open Witchmacs' configuration file for easy editing" + (lambda (&rest _) (find-file "~/.emacs.d/config.el")) + 'default) + (nil + "Open init.el" + "Open init file" + (lambda (&rest _) (find-file "~/.emacs.d/init.el")) + 'default))))) + + +;(insert (concat +; (propertize (format "%d packages loaded in %s" +; (length package-activated-list) (emacs-init-time)) +; 'face 'font-lock-comment-face))) +; +;(dashboard-center-line) + +(use-package which-key + :ensure t + :diminish which-key-mode + :init + (which-key-mode)) + +(use-package swiper + :ensure t + :bind ("C-s" . 'swiper)) + +(use-package evil + :ensure t + :defer nil + :init + (setq evil-want-keybinding nil) + (setq evil-want-C-u-scroll t) + :config + (evil-mode 1)) + +;(use-package evil-collection +; :after evil +; :ensure t +; :config +; (evil-collection-init)) + +(use-package beacon + :ensure t + :diminish beacon-mode + :init + (beacon-mode 1)) + +(use-package avy + :ensure t + :bind + ("M-s" . avy-goto-char)) + +(use-package switch-window + :ensure t + :config + (setq switch-window-input-style 'minibuffer) + (setq switch-window-increase 4) + (setq switch-window-threshold 2) + (setq switch-window-shortcut-style 'qwerty) + (setq switch-window-qwerty-shortcuts + '("a" "s" "d" "f" "j" "k" "l")) + :bind + ([remap other-window] . switch-window)) + +(use-package ido + :init + (ido-mode 1) + :config + (setq ido-enable-flex-matching nil) + (setq ido-create-new-buffer 'always) + (setq ido-everywhere t)) + +(use-package ido-vertical-mode + :ensure t + :init + (ido-vertical-mode 1)) +; This enables arrow keys to select while in ido mode. If you want to +; instead use the default Emacs keybindings, change it to +; "'C-n-and-C-p-only" +(setq ido-vertical-define-keys 'C-n-C-p-up-and-down) + +(use-package async + :ensure t + :init + (dired-async-mode 1)) + +(use-package page-break-lines + :ensure t + :diminish (page-break-lines-mode visual-line-mode)) + +(use-package undo-tree + :ensure t + :diminish undo-tree-mode) + +(use-package treemacs + :ensure t + :defer t + :init + (with-eval-after-load 'winum + (define-key winum-keymap (kbd "M-0") #'treemacs-select-window)) + :config + (progn + (setq treemacs-collapse-dirs (if (executable-find "python3") 3 0) + treemacs-deferred-git-apply-delay 0.5 + treemacs-display-in-side-window t + treemacs-eldoc-display t + treemacs-file-event-delay 5000 + treemacs-file-follow-delay 0.2 + treemacs-follow-after-init t + treemacs-git-command-pipe "" + treemacs-goto-tag-strategy 'refetch-index + treemacs-indentation 2 + treemacs-indentation-string " " + treemacs-is-never-other-window nil + treemacs-max-git-entries 5000 + treemacs-missing-project-action 'ask + treemacs-no-png-images nil + treemacs-no-delete-other-windows t + treemacs-project-follow-cleanup nil + treemacs-persist-file (expand-file-name ".cache/treemacs-persist" user-emacs-directory) + treemacs-recenter-distance 0.1 + treemacs-recenter-after-file-follow nil + treemacs-recenter-after-tag-follow nil + treemacs-recenter-after-project-jump 'always + treemacs-recenter-after-project-expand 'on-distance + treemacs-show-cursor nil + treemacs-show-hidden-files t + treemacs-silent-filewatch nil + treemacs-silent-refresh nil + treemacs-sorting 'alphabetic-desc + treemacs-space-between-root-nodes t + treemacs-tag-follow-cleanup t + treemacs-tag-follow-delay 1.5 + treemacs-width 30) + (treemacs-resize-icons 11) + + (treemacs-follow-mode t) + (treemacs-filewatch-mode t) + (treemacs-fringe-indicator-mode t) + (pcase (cons (not (null (executable-find "git"))) + (not (null (executable-find "python3")))) + (`(t . t) + (treemacs-git-mode 'deferred)) + (`(t . _) + (treemacs-git-mode 'simple)))) + :bind + (:map global-map + ("M-0" . treemacs-select-window) + ("C-x t 1" . treemacs-delete-other-windows) + ("C-x t t" . treemacs) + ("C-x t B" . treemacs-bookmark) + ("C-x t C-t" . treemacs-find-file) + ("C-x t M-t" . treemacs-find-tag))) + +(use-package treemacs-evil + :after treemacs evil + :ensure t) + + (use-package treemacs-icons-dired + :after treemacs dired + :ensure t + :config (treemacs-icons-dired-mode)) + +(use-package magit + :ensure t) + +(use-package eldoc + :diminish eldoc-mode) + +(use-package abbrev + :diminish abbrev-mode) + +(use-package company + :ensure t + :diminish (meghanada-mode company-mode irony-mode) + :config + (setq company-idle-delay 0) + (setq company-minimum-prefix-length 3) + (define-key company-active-map (kbd "M-n") nil) + (define-key company-active-map (kbd "M-p") nil) + (define-key company-active-map (kbd "C-n") #'company-select-next) + (define-key company-active-map (kbd "C-p") #'company-select-previous) + (define-key company-active-map (kbd "SPC") #'company-abort) + :hook + ((java-mode c-mode c++-mode) . company-mode)) + +(use-package yasnippet + :ensure t + :diminish yas-minor-mode + :hook + ((c-mode c++-mode) . yas-minor-mode) + :config + (yas-reload-all)) + +(use-package yasnippet-snippets + :ensure t) + +(use-package company-c-headers + :defer nil + :ensure t) + +(use-package company-irony + :defer nil + :ensure t + :config + (setq company-backends '((company-c-headers + company-dabbrev-code + company-irony)))) +(use-package irony + :defer nil + :ensure t + :config + :hook + ((c++-mode c-mode) . irony-mode) + ('irony-mode-hook) . 'irony-cdb-autosetup-compile-options) + +(use-package meghanada + :ensure t + :defer nil + :config + (add-hook 'java-mode-hook + (lambda () + (meghanada-mode t))) + (setq meghanada-java-path "java") + (setq meghanada-maven-path "mvn")) |
