This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun my-temporary-bind-key-with-restore () | |
"Prompt for a register, a key sequence, and a command to temporarily bind the key to, | |
then automatically restore the original binding after a specified duration." | |
(interactive) | |
(let* ((register (read-char "Choose a register to save the current binding: ")) | |
(key (read-key-sequence "Enter the key sequence to bind: ")) | |
(original-command (key-binding key)) | |
(new-command (read-command "Enter the command to bind to the key: ")) | |
(duration (read-number "Enter the duration in seconds for the temporary binding: "))) | |
;; Save the original key binding to the register |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Defines a transient keymap for movement controls and sets up a global key binding to activate this transient map. This transient map, `my-movement-transient-map`, includes bindings for various movement commands like moving forward or backward by a word or character and moving to the next or previous line. The `activate-my-movement-map` function is defined to activate this transient map, and it is globally bound to `C-f`. | |
;; This setup allows you to press `C-f` followed by one of the specified keys (`f`, `b`, `c`, `l`, `n`, `p`) to perform the corresponding movement operation. The `set-transient-map` call with a second argument of `t` ensures that the transient map stays active until one of its keys is pressed. | |
;; This is a neat way to create a custom, modal-like interface for movement within Emacs, leveraging your Emacs Lisp skills to tailor your editing environment to your preferences. If you have any specific modifications or additional features you'd like to implement, feel free to ask! | |
(defun my-dig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun extract-hex-code-current-line () | |
(interactive) | |
(let ((line (buffer-substring-no-properties (line-beginning-position) (line-end-position)))) | |
(when (string-match "#\\([0-9a-fA-F]\\{6\\}\\)" line) | |
(let ((hex-code (match-string 1 line))) | |
(kill-new hex-code) ; Copy the hex code to the kill ring | |
(message "Copied hex code: %s" hex-code))))) ; Optional: Display a message confirming the action | |
(with-eval-after-load 'help-mode | |
(define-key help-mode-map (kbd "C-c h") 'extract-hex-code-current-line)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
FONT_COLOR=$(shuf -n 1 ~/.motd/colors) | |
FONT_STROKE=$(shuf -n 1 ~/.motd/colors) | |
GRAVITY=$(shuf -n 1 ~/.motd/gravity) | |
WEIGHT=$(shuf -i05-20 -n1) | |
SIZE=$(shuf -i20-100 -n1) | |
FONT=$(randomfont) | |
QUOTE=$(randommotd) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
OUTFILE=$(mktemp --suffix=.tex) | |
BASE_DATE=$(date --date=now +%Y-%m) | |
RED_LETTER_DAY=$(date --date=now +%F) | |
ORIGWAL=$(cat ~/.cache/wal/wal) | |
CAL_COLOR=$(xrdb -query | grep *.color66 | awk -F# '{print $2}') | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
NIGHT_PAPERS=~/Pictures/wallpaper/blue/* | |
DAY_PAPERS=~/Pictures/wallpaper/amber/* | |
if [ $(( $(date --date=now +10#%H) )) -gt 6 ] && [ $(( $(date --date=now +10#%H) )) -lt 19 ] | |
then | |
WALLPAPER_DIR=$DAY_PAPERS | |
else | |
WALLPAPER_DIR=$NIGHT_PAPERS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If this is hard to read in your browser, just copy the text and paste it into your editor. | |
Turn 'line wrapping' on. :) | |
This is a 'how to' for anyone interested in a i3 setup and also for anyone currently | |
using i3 and wants to tweak there setup a little more. I am constantly updating my | |
i3 config with cool 'stuff.' I hope you enjoy reading and if you use some of the code, | |
great! I don't know everything and am still learning, too. :) | |
This is my system settings for i3. Specifically, I use [Manjaro i3](https://forum.manjaro.org/index.php?topic=28022.0). |