(General)~Merge origin/master from oldboy in spiderboy

This commit is contained in:
2022-01-13 04:56:39 +00:00
7 changed files with 80 additions and 62 deletions

3
.gitignore vendored
View File

@@ -1,5 +1,7 @@
TAGS TAGS
*.elc *.elc
*.socket
*.targets.wants.*
/mpd/* /mpd/*
/ncmpcpp/* /ncmpcpp/*
/Emacs/.config/emacs/transient/* /Emacs/.config/emacs/transient/*
@@ -12,4 +14,3 @@ TAGS
/Doom/.config/doom/bookmarks /Doom/.config/doom/bookmarks
/Emacs/.config/emacs/config.el /Emacs/.config/emacs/config.el
/Emacs/.config/emacs/eglot-eclipse-jdt-cache/ /Emacs/.config/emacs/eglot-eclipse-jdt-cache/
/SystemD/.config/systemd/user/

View File

@@ -57,17 +57,23 @@ setup the custom-file to exist in the var-directory
:config :config
(global-auto-revert-mode 1)) (global-auto-revert-mode 1))
#+end_src #+end_src
** Path ** Environment variables
Setting the path variable cos it can get annoying sometimes - Setting the path variable cos it can get annoying sometimes.
- Setting the ssh agent
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package env (use-package env
:defer 1 :defer 1
:straight nil :straight nil
:config :config
(setenv "PATH" (setenv
"PATH" ;
(concat (concat
(expand-file-name "~/.local/bin:") (expand-file-name "~/.local/bin:")
(getenv "PATH")))) (getenv "PATH")))
(setenv
"SSH_AGENT_SOCK"
(shell-command-to-string "echo -n \"${XDG_RUNTIME_DIR}/ssh-agent.socket\"")))
#+end_src #+end_src
* Custom Functions * Custom Functions
These are general custom functions I have defined for various These are general custom functions I have defined for various
@@ -75,29 +81,11 @@ purposes. These encapsulate functionality that could apply to
multiple packages/situations, otherwise I would've defined it in the multiple packages/situations, otherwise I would've defined it in the
place it's required. place it's required.
** Toggle buffer ** Toggle buffer
There are many cases where 'toggling' a buffer is very useful. For Like VSCode's toggling feature for just the terminal, but now for
example, toggling a shell to access it quickly and hide it away with anything I want.
little annoyance.
This is negligible with a bit of Emacs lisp. However, as stated
earlier, there are /many/ cases where this is useful. Following the
DRY principle means a more abstract function would be better to use
here.
One may use higher order functions to create an abstract form that
handles toggling, and then the caller can wrap this call in a new
function if they wish to use it in a keybinding. This format or
construct is kinda common (using a higher order function and wrapping
it in an interactive function for use in a binding), so I created a
macro that further wraps this functionality, creating a custom
function for you.
The macro asks for a function name, a buffer name and the function
necessary to create a buffer with that name. It then generates a
function with the given name that holds the necessary logic to
'toggle' buffers.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(defmacro +dx/create-toggle-function (func-name buf-name buf-create) (with-eval-after-load "window"
(defmacro +dx/create-toggle-function (func-name buf-name buf-create)
"Generate a function named func-name that toggles "Generate a function named func-name that toggles
the buffer with name buf-name and creation function buf-create." the buffer with name buf-name and creation function buf-create."
`(defun ,func-name () `(defun ,func-name ()
@@ -109,8 +97,9 @@ the buffer with name buf-name and creation function buf-create."
(delete-window)) (delete-window))
(t (t
(display-buffer buffer) (display-buffer buffer)
(select-window (get-buffer-window buffer))))))) (select-window (get-buffer-window buffer))))))))
#+end_src #+end_src
<<<<<<< HEAD
** Create auto save ** Create auto save
Macro that defines functionality that runs after a buffer save. Macro that defines functionality that runs after a buffer save.
Requires a list of conditions (so it doesn't happen FOR ALL saved Requires a list of conditions (so it doesn't happen FOR ALL saved
@@ -128,6 +117,11 @@ essentially performs the same task. In particular if you use
get a generated buffer of output from the command, useful for checking get a generated buffer of output from the command, useful for checking
errors and general messages. Better than vim, eh? errors and general messages. Better than vim, eh?
=======
** Auto-run command after-save-hook
Define a macro that can run a body of functionality on a given set of
files on after-save-hook.
>>>>>>> origin/master
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package simple (use-package simple
:straight nil :straight nil
@@ -151,13 +145,21 @@ common use of this macro.
"For a given list of forms CDR, return a quoted non-argument lambda." "For a given list of forms CDR, return a quoted non-argument lambda."
`(quote (lambda () ,@CDR))) `(quote (lambda () ,@CDR)))
#+end_src #+end_src
** Environment setup ** sys-name-cond
Provides a macro to do quick environmental conditionals.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(defconst +dx:environment (system-name)) (defmacro +dx/sys-name-cond (&rest pairs)
(defmacro +dx/env-cond (name &rest to-run) (let ((current-lisp))
`(when (string= +dx:environment ,name) (while pairs
,@to-run)) (let* ((pair (car pairs))
(name (car pair))
(body (cdr pair)))
(add-to-list
'current-lisp
`((string= ,name (system-name)) ,@body))
(setq pairs (cdr pairs))))
`(cond
,@current-lisp)))
>>>>>>> origin/master
#+end_src #+end_src
* Aesthetics * Aesthetics
Load my custom "personal-theme" theme which is stored in the Emacs lisp Load my custom "personal-theme" theme which is stored in the Emacs lisp
@@ -177,8 +179,9 @@ Set font size to 125.
(use-package faces (use-package faces
:straight nil :straight nil
:config :config
(+dx/env-cond "spiderboy" (set-face-attribute 'default nil :height 150)) (+dx/sys-name-cond
(+dx/env-cond "oldboy" (set-face-attribute 'default nil :height 115))) ("spiderboy" (set-face-attribute 'default nil :height 150))
("oldboy" (set-face-attribute 'default nil :height 115))))
#+end_src #+end_src
Turn off the startup buffer because I prefer [[Dashboard]], and write into Turn off the startup buffer because I prefer [[Dashboard]], and write into
@@ -228,9 +231,7 @@ instead just picking stuff I think is useful.
:config :config
(general-def (general-def
:states '(normal motion) :states '(normal motion)
"SPC" nil "SPC" nil)
"M-V" #'+dx/newline
"M-v" (proc (interactive) (+dx/newline 1)))
(general-create-definer leader (general-create-definer leader
:states '(normal motion) :states '(normal motion)

View File

@@ -1,9 +0,0 @@
dmenu
dwm
dwmblocks
emacs
light
pfetch
programs
spotify
xboxdrv

View File

@@ -1,6 +1,7 @@
# zshrc -*- mode: sh; lexical-binding: t; -*- # zshrc -*- mode: sh; lexical-binding: t; -*-
export DOTNET_ROOT=~/.local/src/dotnet export DOTNET_ROOT=~/.local/src/dotnet
export SSH_AUTH_SOCK="${XDG_RUNTIME_DIR}/ssh-agent.socket"
## Variables ## Variables
TERM=xterm-256color TERM=xterm-256color
## Aliases ## Aliases

View File

@@ -0,0 +1,10 @@
[Unit]
Description=SSH agent
[Service]
Type=simple
Environment=SSH_AUTH_SOCK=%t/ssh-agent.socket
ExecStart=/usr/bin/ssh-agent -D -a $SSH_AUTH_SOCK
[Install]
WantedBy=default.target

View File

@@ -9,7 +9,7 @@ xset s 1800;
xrandr --auto --output HDMI1 --primary; xrandr --auto --output HDMI1 --primary;
xrandr --auto --output eDP1 --right-of HDMI1; xrandr --auto --output eDP1 --right-of HDMI1;
xrandr --auto --output VGA1 --primary --left-of DP2; xrandr --auto --output VGA1 --primary --left-of DP2;
xrandr --auto --output DP2 --rotate left; xrandr --auto --output DP2 left;
$(xss-lock --transfer-sleep-lock -- $HOME/.local/scripts/lock) & $(xss-lock --transfer-sleep-lock -- $HOME/.local/scripts/lock) &
$HOME/.local/scripts/background & $HOME/.local/scripts/background &

14
programs Normal file
View File

@@ -0,0 +1,14 @@
dmenu
dwm
dwmblocks
emacs
komorebi
light
minecraft-launcher
omnisharp
pfetch
snapd
spotify
teams
xboxdrv
yay-bin