Compare commits

..
8 Commits
Author SHA1 Message Date
JosephFerano 69af07dc49 emacs: require org? 2026-05-11 13:22:02 +07:00
JosephFerano 017c4b0b7d emacs: guard against missing gptel keys 2026-05-11 13:19:52 +07:00
JosephFerano 77b1b6f999 emacs: comment out dotenv 2026-05-11 13:14:37 +07:00
JosephFerano 5c4d83590c emacs: centaur tabs package 2026-05-11 13:10:11 +07:00
JosephFerano a949d2b57b emacs: C-x b 2026-05-11 13:07:22 +07:00
JosephFerano 45ed3a8081 script: battery-notify check if we are already on AC 2026-05-09 18:02:46 +07:00
JosephFerano eebfbdf622 fish: I don't know 2026-05-09 18:02:43 +07:00
JosephFerano 508bdeb553 qtile: Move to corners 2026-05-09 18:02:01 +07:00
5 changed files with 71 additions and 28 deletions

No files matched your search

+23 -17
View File
@@ -205,6 +205,7 @@ Finish up
all-the-icons-completion
;; eat
;; Enhancements
centaur-tabs
olivetti
helpful
vterm
@@ -1020,10 +1021,7 @@ Fill region is great, except when you don't need it...
(require 'all-the-icons-ibuffer)
(add-hook 'ibuffer-mode-hook #'all-the-icons-ibuffer-mode)
(global-set-key [remap list-buffers] 'ibuffer)
(evil-define-key '(normal insert visual emacs) 'global
(kbd "C-b") #'consult-buffer)
(evil-define-key '(normal insert visual emacs) 'global
(kbd "C-S-b") #'ibuffer)
(global-set-key (kbd "C-x b") #'consult-buffer)
(defun joe/switch-other-buffer ()
"Switch to other buffer"
@@ -2179,19 +2177,26 @@ start it, so go through all existing buffers that match the mode and belong to t
#+end_src
** AI
#+begin_src emacs-lisp
(setq gptel-default-mode #'org-mode)
(setq gptel-api-key (with-temp-buffer
(insert-file-contents (expand-file-name "gptel-gpt-key" user-emacs-directory))
(buffer-string)))
(gptel-make-anthropic "Claude" :stream t :key (with-temp-buffer
(insert-file-contents (expand-file-name "gptel-key" user-emacs-directory))
(buffer-string)))
(gptel-make-openai "ChatGPT" :stream t :key (with-temp-buffer
(insert-file-contents (expand-file-name "gptel-gpt-key" user-emacs-directory))
(buffer-string)))
(setq gptel-model 'claude-sonnet-4-6)
(setq gptel-backend (gptel-get-backend "Claude"))
(defun joe/read-file-or-nil (filename)
"Read FILENAME from emacs directory, return nil if file doesn't exist."
(let ((path (expand-file-name filename user-emacs-directory)))
(when (file-exists-p path)
(with-temp-buffer
(insert-file-contents path)
(string-trim (buffer-string))))))
(setq gptel-default-mode #'org-mode)
(when-let ((gpt-key (joe/read-file-or-nil "gptel-gpt-key")))
(setq gptel-api-key gpt-key))
(when-let ((claude-key (joe/read-file-or-nil "gptel-key")))
(gptel-make-anthropic "Claude" :stream t :key claude-key)
(setq gptel-model 'claude-sonnet-4-6)
(setq gptel-backend (gptel-get-backend "Claude")))
(when-let ((gpt-key (joe/read-file-or-nil "gptel-gpt-key")))
(gptel-make-openai "ChatGPT" :stream t :key gpt-key))
(setq gptel-prompt-prefix-alist '((markdown-mode . "### ")
(org-mode . "* ")
@@ -2425,7 +2430,7 @@ it doesn't close it.
(deactivate-mark))))
;; This is required so that .dir-locals that read env files for credentials works
(require 'dotenv)
;; (require 'dotenv)
(defun joe/sql-mode-hook ()
(define-key sql-mode-map (kbd "C-M-h") #'joe/mark-sql-defun)
(define-key sql-mode-map (kbd "C-M-x") #'sql-send-pg-function)
@@ -2505,6 +2510,7 @@ Apparently this helps with the performance of dape, as well as LSP
** org-mode
*** General
#+begin_src emacs-lisp
(require 'org)
(setq org-todo-keywords '((sequence "TODO" "IN-PROGRESS" "|" "DONE" "BACKLOG")))
(setq org-directory "~/Notes/")
+4 -6
View File
@@ -1,6 +1,3 @@
if status is-interactive
# Commands to run in interactive sessions can go here
end
set -gx XDG_CONFIG_HOME /home/joe/.config
set -gx XDG_DATA_HOME /home/joe/.local/share
set -gx XDG_CACHE_HOME /home/joe/.cache
@@ -76,12 +73,13 @@ end
fish_ssh_agent
# The next line updates PATH for the Google Cloud SDK.
if [ -f '/home/joe/Downloads/google-cloud-sdk/path.fish.inc' ]; . '/home/joe/Downloads/google-cloud-sdk/path.fish.inc'; end
# if [ -f '/home/joe/Downloads/google-cloud-sdk/path.fish.inc' ]; . '/home/joe/Downloads/google-cloud-sdk/path.fish.inc'; end
# opam configuration
source /home/joe/.opam/opam-init/init.fish > /dev/null 2> /dev/null; or true
# source /home/joe/.opam/opam-init/init.fish > /dev/null 2> /dev/null; or true
if test -e "/home/joe/Repositories/emsdk/emsdk_env.fish"
source "/home/joe/Repositories/emsdk/emsdk_env.fish"
set -gx EMSDK_QUIET 1
end
end
alias claude="/home/joe/.claude/local/claude"
+2 -2
View File
@@ -15,7 +15,7 @@ SETUVAR WINEPREFIX:/home/joe/\x2elocal/share/wine
SETUVAR XDG_CACHE_HOME:/home/joe/\x2ecache
SETUVAR XDG_CONFIG_HOME:/home/joe/\x2econfig
SETUVAR XDG_DATA_HOME:/home/joe/\x2elocal/share
SETUVAR __fish_initialized:3400
SETUVAR __fish_initialized:3800
SETUVAR _fisher_ankitsumitg_2F_docker_2D_fish_2D_completions_files:/home/joe/\x2econfig/fish/completions/docker\x2efish
SETUVAR _fisher_plugins:ankitsumitg/docker\x2dfish\x2dcompletions
SETUVAR fish_color_autosuggestion:969896
@@ -36,7 +36,7 @@ SETUVAR fish_color_operator:00a6b2
SETUVAR fish_color_param:81a2be
SETUVAR fish_color_quote:b5bd68
SETUVAR fish_color_redirection:8abeb7
SETUVAR fish_color_search_match:bryellow\x1e\x2d\x2dbackground\x3dbrblack
SETUVAR fish_color_search_match:white\x1e\x2d\x2dbackground\x3dbrblack
SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack
SETUVAR fish_color_status:red
SETUVAR fish_color_user:brgreen
+37 -3
View File
@@ -84,6 +84,34 @@ def new_client(client):
y = client.group.screen.height - client.height - padding - 22
client.set_position_floating(x,y)
def move_to_corner(corner: str) -> Callable:
def _inner(qtile) -> None:
win = qtile.current_window
if win is None:
return
if not win.floating:
win.toggle_floating()
screen = qtile.current_screen
padding = 0
bar_height = 24
w = win.width
h = win.height
sw = screen.width
sh = screen.height
positions = {
"top-left": (padding, bar_height + padding),
"top-right": (sw - w - padding, bar_height + padding),
"bottom-left": (padding, sh - h - padding),
"bottom-right": (sw - w - padding, sh - h - padding),
}
x, y = positions[corner]
win.set_position_floating(x, y)
return _inner
keys = [
# A list of available commands that can be bound to keys can be found
# at https://docs.qtile.org/en/latest/manual/config/lazy.html
@@ -91,8 +119,8 @@ keys = [
# .when(wm_class != 'kitty')
# Key([mod], "h", lazy.function(move_focus, direction='left'), desc="Move focus to left"),
Key([mod], "h", lazy.layout.left().when(focused=Match(wm_class=re.compile('(?![Ee]macs)'))), desc="Move focus to left"),
Key([mod], "j", lazy.layout.down().when(focused=Match(wm_class=re.compile('(?![Ee]macs)'))), desc="Move focus to left"),
Key([mod], "k", lazy.layout.up().when(focused=Match(wm_class=re.compile('(?![Ee]macs)'))), desc="Move focus to left"),
# Key([mod], "j", lazy.layout.down().when(focused=Match(wm_class=re.compile('(?![Ee]macs)'))), desc="Move focus to left"),
# Key([mod], "k", lazy.layout.up().when(focused=Match(wm_class=re.compile('(?![Ee]macs)'))), desc="Move focus to left"),
Key([mod], "l", lazy.layout.right().when(focused=Match(wm_class=re.compile('(?![Ee]macs)'))), desc="Move focus to left"),
# Key([alt], "tab", lazy.layout.next(), desc="Move window focus to other window"),
@@ -161,19 +189,25 @@ keys = [
),
Key([mod], "t", lazy.window.toggle_floating(), desc="Toggle floating on the focused window"),
Key([mod, "control"], "r", lazy.reload_config(), desc="Reload the config"),
Key([mod, "shift"], "r", lazy.spawn("reload_wm.sh"), desc="Kill Unity"),
Key([mod, "control"], "q", lazy.shutdown(), desc="Shutdown Qtile"),
Key([mod, alt], "space", lazy.function(toggle_language), desc="Toggle Language Layout"),
Key([mod], "r", lazy.spawncmd(), desc="Spawn a command using a prompt widget"),
Key([], "XF86AudioLowerVolume", lazy.spawn("amixer sset Master 5%-")),
Key([], "XF86AudioRaiseVolume", lazy.spawn("amixer sset Master 5%+")),
Key([], "XF86Launch1", lazy.spawn("playerctl play-pause")),
Key([], "XF86AudioMicMute", lazy.spawn("playerctl play-pause")),
Key([], "XF86AudioPlay", lazy.spawn("playerctl play-pause")),
Key([], "XF86MonBrightnessDown", lazy.spawn("brightnessctl set 5%-")),
Key([], "XF86MonBrightnessUp", lazy.spawn("brightnessctl set +5%")),
# This uses discrete values
Key([], "XF86KbdBrightnessDown", lazy.function(kbd_brightness_down)),
Key([], "XF86KbdBrightnessUp", lazy.function(kbd_brightness_up)),
Key([mod, "control", "shift", alt], "1", lazy.window.set_position_floating(5, 28), desc="Put the window in the corner"),
Key([mod, alt, "control", "shift"], "q", lazy.function(move_to_corner("top-left")), desc="Move float to top-left"),
Key([mod, alt, "control", "shift"], "w", lazy.function(move_to_corner("top-right")), desc="Move float to top-right"),
Key([mod, alt, "control", "shift"], "a", lazy.function(move_to_corner("bottom-left")), desc="Move float to bottom-left"),
Key([mod, alt, "control", "shift"], "s", lazy.function(move_to_corner("bottom-right")), desc="Move float to bottom-right"),
]
pape_dir = '/home/joe/Pictures/Wallpapers/'
+5
View File
@@ -1,6 +1,11 @@
#!/bin/bash
BATTERY_LEVEL=$(upower -i $(upower -e | grep 'BAT') | grep -E "percentage" | awk '{print $2}' | sed 's/%//')
AC_POWER=$(cat /sys/class/power_supply/AC0/online)
if [ $AC_POWER -eq 1 ]; then
exit
fi
if [ $BATTERY_LEVEL -le 5 ]; then
notify-send "Low Battery" "Battery level is ${BATTERY_LEVEL}%" -u critical
exit