Compare commits

...

5 Commits

4 changed files with 211 additions and 42 deletions

View File

@ -1,3 +1,7 @@
#!/bin/sh
. "$HOME"/.profile.private
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.local/share"
@ -52,6 +56,7 @@ export CHROME_EXECUTABLE=/usr/bin/chromium
export DENO_DIR="$HOME/.config/deno"
export DENO_INSTALL_ROOT="$HOME/.local/bin/deno"
export DIFFPROG=ediff
export SUDO_ASKPASS="$HOME/.local/bin/askpass"
export MANPAGER="sh -c 'col -bx | bat -l man -p'"

View File

@ -302,6 +302,59 @@ NB_CONTAINERS=$(docker ps -q | wc -l | tr -d '\n')
printf "^f3^f0 %d" $NB_CONTAINERS
#+end_src
** Kamoji Generator
:PROPERTIES:
:CUSTOM_ID: cliutilitiesKamojiGenerator-sqvh17015uj0
:HEADER-ARGS: :shebang "#!/usr/bin/env sh" :tangle ~/.local/bin/kamoji
:END:
This script comes straight from [[https://charm.sh/blog/kamoji-generator/][this blog post]] and generates kamoji. I
modified it a bit in order to work with either =xclipboard= or =wl-copy=
depending on whether I am in a X.org session or a Wayland session.
Note that it requires the =OPENAI_API_KEY= environment variable to be
set with a valid OpenAI key.
#+begin_src bash
# If the user passes '-h', '--help', or 'help' print out a little bit of help.
# text.
case "$1" in
"-h" | "--help" | "help")
printf 'Generate kaomojis on request.\n\n'
printf 'Usage: %s [kind]\n' "$(basename "$0")"
exit 1
;;
esac
# The user can pass an argument like "bear" or "angry" to specify the general
# kind of Kaomoji produced.
sentiment=""
if [[ $1 != "" ]]; then
sentiment=" $1"
fi
# Ask mods to generate Kaomojis. Save the output in a variable.
kaomoji="$(mods "generate 10${sentiment} kaomojis. number them and put each one on its own line.")"
if [[ $kaomoji == "" ]]; then
exit 1
fi
# Pipe mods output to gum so the user can choose the perfect kaomoji. Save that
# choice in a variable. Also note that we're using cut to drop the item number
# in front of the Kaomoji.
choice="$(echo "$kaomoji" | gum choose | cut -d ' ' -f 2)"
if [[ $choice == "" ]]; then
exit 1
fi
# If the current session is Wayland, copy with wl-copy, otherwise copy with xclipboard
if [ "$XDG_SESSION_TYPE" = "wayland" ]
then printf '%s' "$choice" | wc-copy # X11
else printf '%s' "$choice" | xclip -sel clip # Wayland
fi
# We're done!
printf 'Copied %s to the clipboard\n' "$choice"
#+end_src
** mu-unread
:PROPERTIES:
:HEADER-ARGS: :shebang "#!/usr/bin/env sh" :tangle ~/.local/bin/mu-unread
@ -616,10 +669,22 @@ xinput map-to-output "$ID" "$SCREEN"
:CUSTOM_ID: Emacs-stuff-Dired-2eeca9da
:HEADER-ARGS: :shebang "#!/bin/bash" :mkdirp yes :tangle ~/.local/bin/dired
:END:
This script allows me to open anything in dired from the command line.
#+BEGIN_SRC bash
emacsclient -c -a emacs -e "(dired \"$*\")"
#+END_SRC
** Ediff
:PROPERTIES:
:CUSTOM_ID: EmacsstuffEdiff-a6adcl503uj0
:HEADER-ARGS: :shebang "#!/bin/bash" :mkdirp yes :tangle ~/.local/bin/ediff
:END:
I want Ediff as my merge tool, not just with Git but with other
programs too such as =pacdiff=.
#+begin_src bash
emacsclient -c -a emacs -e "(ediff-files \"$1\" \"$2\")"
#+end_src
** Emacsmail
:PROPERTIES:
:HEADER-ARGS: :shebang "#!/bin/bash" :mkdirp yes :tangle ~/.local/bin/emacsmail

View File

@ -1421,6 +1421,79 @@ in order to interact with Bitwarden in Emacs with the help of the
:repo "https://labs.phundrak.com/phundrak/bitwarden.el"))
#+end_src
*** Calendar
:PROPERTIES:
:CUSTOM_ID: PackagesConfigurationApplicationsCalendar-u7c4vcb07uj0
:END:
I am using the built-in calendar of Emacs, but as I use Evil and the
bépo layout, many keybindings available by default or through
=evil-collection= dont fit my needs perfectly.
#+begin_src emacs-lisp
(use-package calendar
:straight (:type built-in)
:defer t
:general
(:keymaps 'calendar-mode-map
"»" #'calendar-scroll-left
"«" #'calendar-scroll-right
"M-»" #'calendar-scroll-left-three-months
"M-«" #'calendar-scroll-right-three-months
"M-r" #'calendar-scroll-left
"M-c" #'calendar-scroll-right
"M-S-r" #'calendar-scroll-left-three-months
"M-S-c" #'calendar-scroll-right-three-months
"q" #'calendar-exit)
(phundrak/major-leader-key
:keymaps 'calendar-mode-map
"=" #'calendar-count-days-region
"^" '(:ignore t :wk "beginning")
"^ w" #'calendar-beginning-of-week
"^ m" #'calendar-beginning-of-month
"^ y" #'calendar-beginning-of-year
"$" '(:ignore t :wk "end")
"$w" #'calendar-end-of-week
"$m" #'calendar-end-of-month
"$y" #'calendar-end-of-year
"a" '(:ignore t :wk "appointment")
"aa" #'appt-add
"ad" #'appt-delete
"A" #'org-calendar-goto-agenda
"b" '(:ignore t :wk "go back")
"bd" '(calendar-backward-day :wk "a day")
"bw" '(calendar-backward-week :wk "a week")
"bm" '(calendar-backward-month :wk "a month")
"by" '(calendar-backward-year :wk "a year")
"d" '(:ignore t :wk "diary")
"da" '(diary-show-all-entries :wk "all entries")
"dd" '(diary-view-entries :wk "entries")
"dm" #'diary-mark-entries
"do" #'diary-view-other-diary-entries
"di" '(:ignore t :wk "insert")
"die" '(diary-insert-entry :wk "entry")
"die" '(diary-insert-block-entry :wk "block entry")
"diw" '(diary-insert-weekly-entry :wk "weekly")
"dim" '(diary-insert-monthly-entry :wk "monthly")
"diy" '(diary-insert-yearly-entry :wk "yearly")
"F" '(:ignore t :wk "files")
"Fa" #'org-calendar-goto-agenda
"f" '(:ignore t :wk "go forward")
"fd" '(calendar-forward-day :wk "a day")
"fw" '(calendar-forward-week :wk "a week")
"fm" '(calendar-forward-month :wk "a month")
"fy" '(calendar-forward-year :wk "a year")
"g" '(:ignore t :wk "goto")
"gd" #'calendar-goto-date
"gm" #'calendar-other-month
"gt" #'calendar-goto-today
"h" '(:ignore t :wk "holidays")
"hl" #'calendar-list-holidays
"hm" #'calendar-mark-holidays
"H" '(:ignore t :wk "HTML export")
"Hm" #'cal-html-cursor-month
"Hy" #'cal-html-cursor-year
"M" #'calendar-other-month))
#+end_src
*** Docker
:PROPERTIES:
:CUSTOM_ID: Packages-Configuration-Applications-Docker5ul0fl6184j0
@ -4624,6 +4697,20 @@ the usage of the ~:ignore:~ tag in org.
(setq org-agenda-files (list "~/org/agenda" "~/org/notes.org"))
#+end_src
#+begin_src emacs-lisp
(use-package org-caldav
:straight (:build t)
:defer t
:config
(setq org-caldav-url "https://nextcloud.phundrak.com/remote.php/dav/calendars/phundrak"
org-icalendar-timezone "Europe/Paris"
org-caldav-calendars
`((:calendar-id "personal" :files ("~/org/agenda/private.org")
:inbox "~/org/agenda/private.org")
(:calendar-id "contact_birthdays" :files ("~/org/agenda/birthdays.org")
:inbox "~/org/agenda/birthdays.org"))))
#+end_src
*** Babel
:PROPERTIES:
:CUSTOM_ID: Packages-Configuration-Org-mode-Babel9585fl6184j0
@ -7678,7 +7765,7 @@ First, here is its major mode.
"A zig syntax checker using the zig-fmt interpreter."
:command ("zig" "fmt" (eval (buffer-file-name)))
:error-patterns
((error line-start (file-name) ":" line ":" column ": error: " (mesage) line-end))
((error line-start (file-name) ":" line ":" column ": error: " (message) line-end))
:modes zig-mode)
(add-to-list 'flycheck-checkers 'zig)
:general
@ -7707,48 +7794,54 @@ paru --skipreview --noconfirm -S zls-bin 2>&1
:: Calculating conflicts...
:: Calculating inner conflicts...
Aur (1) zls-bin-0.9.0-2
Aur (1) Old Version New Version Make Only
aur/zls-bin 0.10.0-1 No
:: Proceed with installation? [Y/n]:
:: Downloading PKGBUILDs...
PKGBUILDs up to date
fetching devel info...
==> Making package: zls-bin 0.9.0-2 (2022-01-17T00:43:50 CET)
==> Making package: zls-bin 0.10.0-1 (ven. 19 mai 2023 11:23:59)
==> Retrieving sources...
-> Found zls-LICENSE.txt
-> Found zls-bin-0.9.0.tar.gz
-> Downloading zls-LICENSE.txt...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 100 1091 100 1091 0 0 3596 0 --:--:-- --:--:-- --:--:-- 3600
-> Downloading zls-bin-0.10.0.tar.gz...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
56 1477k 56 827k 0 0 1164k 0 0:00:01 --:--:-- 0:00:01 1164k 100 1477k 100 1477k 0 0 2012k 0 --:--:-- --:--:-- --:--:-- 27.5M
==> Validating source files with sha256sums...
zls-LICENSE.txt ... Passed
==> Validating source_x86_64 files with sha256sums...
zls-bin-0.9.0.tar.gz ... Passed
==> Making package: zls-bin 0.9.0-2 (2022-01-17T00:43:51 CET)
zls-bin-0.10.0.tar.gz ... Passed
==> Making package: zls-bin 0.10.0-1 (ven. 19 mai 2023 11:24:02)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
-> Found zls-LICENSE.txt
-> Found zls-bin-0.9.0.tar.gz
-> Found zls-bin-0.10.0.tar.gz
==> Validating source files with sha256sums...
zls-LICENSE.txt ... Passed
==> Validating source_x86_64 files with sha256sums...
zls-bin-0.9.0.tar.gz ... Passed
zls-bin-0.10.0.tar.gz ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
-> Extracting zls-bin-0.9.0.tar.gz with bsdtar
-> Extracting zls-bin-0.10.0.tar.gz with bsdtar
==> Sources are ready.
zls-bin-0.9.0-2: parsing pkg list...
:: zls-bin-0.9.0-2 is up to date -- skipping build
warning: zls-bin-0.9.0-2 is up to date -- reinstalling
zls-bin-0.10.0-1: parsing pkg list...
:: zls-bin-0.10.0-1 is up to date -- skipping build
loading packages...
resolving dependencies...
looking for conflicting packages...
Package (1) Old Version New Version Net Change
Package (1) New Version Net Change
zls-bin 0.9.0-2 0.9.0-2 0,00 MiB
zls-bin 0.10.0-1 1,36 MiB
Total Installed Size: 1,16 MiB
Net Upgrade Size: 0,00 MiB
Total Installed Size: 1,36 MiB
:: Proceed with installation? [Y/n]
checking keyring...
@ -7757,12 +7850,10 @@ loading package files...
checking for file conflicts...
checking available disk space...
:: Processing package changes...
reinstalling zls-bin...
Consider re-running 'zls config' to reconfigure the language server
installing zls-bin...
Consider runing 'zls --config' to setup initial configuration
Some options may have changed when upgrading from 0.9.0-2 -> 0.9.0-2
Make sure to backup your old configuration!
This is not required, but it is highly recommended
:: Running post-transaction hooks...
(1/2) Arming ConditionNeedsUpdate...
(2/2) Refreshing PackageKit...
@ -8431,24 +8522,27 @@ Undefining some stuff to make keybind prefixes work correctly.
:END:
Here are my apps keybinds. Each one of them is prefixed by ~a~.
#+name: keybinds-apps
| Key | Function | Description | Package |
|-----+----------------------------+-------------+----------|
| | | apps | |
| c | calc | | |
| d | docker | | |
| E | elfeed | | |
| e | | email | |
| ec | mu4e-compose-new | | |
| em | mu4e | | |
| k | keycast-mode | | |
| K | keycast-log-mode | | |
| m | | mastodon | |
| mm | mastodon | | mastodon |
| mn | mastodon-notifications-get | | mastodon |
| mt | mastodon-toot | | mastodon |
| T | tetris | | |
| w | wttrin | | wttrin |
| C | calendar | | |
| Key | Function | Description | Package |
|-----+----------------------------+-------------+------------|
| | | apps | |
| c | calc | | |
| C | | calendar | |
| CC | calendar | | |
| Co | org-agenda | | org |
| Cs | org-caldav-sync | | org-caldav |
| d | docker | | |
| E | elfeed | | |
| e | | email | |
| ec | mu4e-compose-new | | |
| em | mu4e | | |
| k | keycast-mode | | |
| K | keycast-log-mode | | |
| m | | mastodon | |
| mm | mastodon | | mastodon |
| mn | mastodon-notifications-get | | mastodon |
| mt | mastodon-toot | | mastodon |
| T | tetris | | |
| w | wttrin | | wttrin |
I also have two main shell-related functions, prefixed with ~as~.
#+name: keybinds-apps-shell

View File

@ -331,11 +331,16 @@ To save the current desktop, I can write a wrapper around
#+end_src
Basically the same goes for loading the desktop layout, but this time
its ~restore-from-file~ thats wrapped.
its ~restore-from-file~ thats wrapped. I also want to launch Global
Protect at the same time, because I always forget to before launching
~launch-work~ described below, and automatically connect my bluetooth
headset.
#+begin_src lisp
(defcommand at-work () ()
"Restore desktop layout when at work."
(restore-from-file *my/desktop-dump-file*))
(restore-from-file *my/desktop-dump-file*)
(run-shell-command "gpclient")
(run-shell-command "bluetoothctl power on && bluetoothctl connect 14:3F:A6:6D:E3:D9"))
#+end_src
If I want to quickly launch all programs I will need, I can also