Compare commits
No commits in common. "d2cbdc32894d96c781d96fb09b30895ccdb4c224" and "a04de69b1043f8ede01ec05af303234dd27a5ba4" have entirely different histories.
d2cbdc3289
...
a04de69b10
|
@ -1034,7 +1034,7 @@ rm $TMPBG
|
|||
|
||||
* Polybar-launch (Deprecated) :noexport:
|
||||
:PROPERTIES:
|
||||
:HEADER-ARGS: :shebang "#!/usr/bin/env bash" :mkdirp yes :tangle ~/.local/bin/polybar-launch
|
||||
:HEADER-ARGS: :shebang "#!/usr/bin/env fish" :mkdirp yes :tangle ~/.local/bin/polybar-launch
|
||||
:CUSTOM_ID: Polybar-launch-36789edc
|
||||
:END:
|
||||
This scripts allows the user to kill polybar and relaunch it, or to simply
|
||||
|
|
|
@ -21,8 +21,7 @@ in progress document, lots of comments on existing configuration are
|
|||
missing, and lots of functionalities are still not implemented. I’m
|
||||
still in the process of porting my [[file:spacemacs.org][Spacemacs]] configuration over here.
|
||||
|
||||
#+attr_html: :alt Dammit Emacs… :loading lazy
|
||||
#+caption: XKCD n°378
|
||||
#+attr_html: :alt Dammit Emacs…
|
||||
[[file:./img/real_programmers.png]]
|
||||
|
||||
* Basic configuration
|
||||
|
@ -3472,41 +3471,6 @@ files.
|
|||
(setq preview-org-html-refresh-configuration 'save))
|
||||
#+end_src
|
||||
|
||||
**** Hugo
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: Packages-Configuration-Org-mode-Exporters-Hugo-ca3473613aj0
|
||||
:END:
|
||||
I manage [[https://blog.phundrak.com][my blog]] with [[https://gohugo.io/][Hugo]]. Although it natively supports the org
|
||||
format, it’s not great compared to its markdown support. So, instead,
|
||||
let’s directly export our org files as markdown files and let Hugo do
|
||||
the rest of the job for us!
|
||||
#+begin_src emacs-lisp
|
||||
(use-package ox-hugo
|
||||
:defer t
|
||||
:after ox
|
||||
:straight t)
|
||||
#+end_src
|
||||
|
||||
I also have a function for publishing my blog once I exported my
|
||||
articles with ~ox-hugo~. It will compile blog into a ~public/~ directory
|
||||
and copy its content over to my remote server.
|
||||
#+begin_src emacs-lisp
|
||||
(defun phundrak/blog-publish ()
|
||||
"Publish my blog through Hugo to my remote server."
|
||||
(interactive)
|
||||
(let* ((default-directory (expand-file-name "~/org/blog"))
|
||||
(public-path (concat default-directory "/public"))
|
||||
(target-path "/rsync:Tilo:/home/phundrak/www/phundrak.com/blog"))
|
||||
(compile "hugo")
|
||||
(let ((files (mapcar (lambda (file)
|
||||
(f-relative file public-path))
|
||||
(f-files public-path nil t))))
|
||||
(dolist (file files)
|
||||
(copy-file (concat public-path "/" file)
|
||||
(concat target-path "/" file)
|
||||
t nil t)))))
|
||||
#+end_src
|
||||
|
||||
**** LaTeX
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: Packages-Configuration-Org-mode-File-export-LaTeXg2b5fl6184j0
|
||||
|
@ -3590,6 +3554,22 @@ add their extension like so:
|
|||
(add-to-list 'org-latex-logfiles-extensions ext t))
|
||||
#+end_src
|
||||
|
||||
**** Markdown
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: Packages-Configuration-Org-mode-File-export-Markdown-g2vh5vz095j0
|
||||
:END:
|
||||
There’s not really any unified Markdown specification, meaning
|
||||
everyone can pretty much do whatever they want with the syntax and
|
||||
still call it Markdown. Great… But something I appreciate is Github
|
||||
supports some extra HTML to make our files extra spicy! And lucky me,
|
||||
there’s a package for exporting my org files to Github-flavored
|
||||
Markdown!
|
||||
#+begin_src emacs-lisp
|
||||
(use-package ox-gfm
|
||||
:after (ox org)
|
||||
:straight (:build t))
|
||||
#+end_src
|
||||
|
||||
**** Reveal.js
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: Packages-Configuration-Org-mode-File-export-Reveal-js-mzijhel099j0
|
||||
|
|
|
@ -359,42 +359,11 @@ need to reload them now that we modified them.
|
|||
|
||||
And with that we’re done!
|
||||
|
||||
* Mode-Line
|
||||
* Modeline
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: Modeline-g2ofyw01v5j0
|
||||
:header-args:lisp: :mkdirp yes :tangle ~/.stumpwm.d/modeline.lisp
|
||||
:END:
|
||||
The timeout of the modeline indicates how often it refreshes in
|
||||
seconds. I think two seconds is good.
|
||||
#+begin_src lisp
|
||||
(setf *mode-line-timeout* 2)
|
||||
#+end_src
|
||||
|
||||
** Formatting Options
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: Mode-Line-Formatting-Options-3n494y814aj0
|
||||
:END:
|
||||
Next we get to the content of the modeline. This format follows the
|
||||
format indicated in the manpage of ~date~.
|
||||
#+begin_src lisp
|
||||
(setf *time-modeline-string* "%F %H:%M")
|
||||
#+end_src
|
||||
|
||||
Let’s also indicate how the groupname is displayed.
|
||||
#+begin_src lisp
|
||||
(setf *group-format* "%t")
|
||||
#+end_src
|
||||
|
||||
The window format should display first its window number, then its
|
||||
titled, limited to 30 characters.
|
||||
#+begin_src lisp
|
||||
(setf *window-format* "%n: %30t")
|
||||
#+end_src
|
||||
|
||||
** Mode-Line Theme
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: Mode-Line-Mode-Line-Theme-4mm37x814aj0
|
||||
:END:
|
||||
The modeline is pretty easy. First, let’s load the ~colors.lisp~ file we just created:
|
||||
#+begin_src lisp
|
||||
(load "~/.stumpwm.d/colors.lisp")
|
||||
|
@ -415,19 +384,38 @@ still set its color to Nord1, just in case.
|
|||
,*mode-line-border-width* 0)
|
||||
#+end_src
|
||||
|
||||
** Mode-Line Modules
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: Mode-Line-Mode-Line-Modules-tlihmy814aj0
|
||||
:END:
|
||||
The timeout of the modeline indicates how often it refreshes in
|
||||
seconds. I think two seconds is good.
|
||||
#+begin_src lisp
|
||||
(setf *mode-line-timeout* 2)
|
||||
#+end_src
|
||||
|
||||
Next we get to the content of the modeline. This format follows the
|
||||
format indicated in the manpage of ~date~.
|
||||
#+begin_src lisp
|
||||
(setf *time-modeline-string* "%F %H:%M")
|
||||
#+end_src
|
||||
|
||||
Let’s also indicate how the groupname is displayed.
|
||||
#+begin_src lisp
|
||||
(setf *group-format* "%t")
|
||||
#+end_src
|
||||
|
||||
The window format should display first its window number, then its
|
||||
titled, limited to 30 characters.
|
||||
#+begin_src lisp
|
||||
(setf *window-format* "%n: %30t")
|
||||
#+end_src
|
||||
|
||||
Here are some modules that we will load for the modeline:
|
||||
#+name: modeline-modules
|
||||
| Module Name | Why Do I Need It? |
|
||||
| Module Name | Why It Is Loaded |
|
||||
|------------------+--------------------------------------------------|
|
||||
| battery-portable | Get information on the battery level of a laptop |
|
||||
| cpu | Get the CPU usage |
|
||||
| mpd | Display MPD’s status |
|
||||
| mem | Get the memory usage |
|
||||
| net | Display network usage |
|
||||
| net | |
|
||||
| wifi | Display information about Wifi connectivity |
|
||||
|
||||
#+name: gen-load-modeline-modules
|
||||
|
@ -449,7 +437,8 @@ Here are some modules that we will load for the modeline:
|
|||
(load-module "wifi")
|
||||
#+end_src
|
||||
|
||||
We need to set some variables so modules can be displayed correctly.
|
||||
Some variables need to be set so modules are displayed correctly.
|
||||
|
||||
Note that the character between the font switchers in the second CPU
|
||||
formatter is U+E082, which symbolizes the CPU.
|
||||
#+begin_src lisp
|
||||
|
@ -464,10 +453,6 @@ formatter is U+E082, which symbolizes the CPU.
|
|||
,*mode-line-highlight-template* "«~A»")
|
||||
#+end_src
|
||||
|
||||
** Generating the Mode-Line
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: Modeline-Generating-the-Mode-Line-daw8qp814aj0
|
||||
:END:
|
||||
We can indicate what to display in our modeline. Each formatter will
|
||||
be separated by a Powerline separator with the code point ~0xE0B0~ in
|
||||
the font I am using (see §[[#Theme-Fonts-28pc8141v5j0]]).
|
||||
|
@ -501,15 +486,6 @@ the font I am using (see §[[#Theme-Fonts-28pc8141v5j0]]).
|
|||
: (("%g") ("%W") ("^>") ("mu-unread" . t) ("%m") ("%I") ("%l") ("%C") ("%M") ("%B") ("%d"))
|
||||
|
||||
#+begin_src lisp :noweb yes
|
||||
(defvar *mode-line-formatter-list*
|
||||
'<<modeline-format-gen()>>
|
||||
"List of formatters for the modeline.")
|
||||
#+end_src
|
||||
|
||||
As you can see, ~generate-modeline~ generates the string defining
|
||||
~*screen-mode-line-format*~ from the list of formatters we gave it with
|
||||
the table [[modeline-format]].
|
||||
#+begin_src lisp
|
||||
(defun generate-modeline (elements &optional not-invertedp)
|
||||
"Generate a modeline for StumpWM.
|
||||
ELEMENTS should be a list of `cons'es which `car' is the modeline
|
||||
|
@ -533,27 +509,25 @@ when the `car' is a formatter and t when it is a shell command."
|
|||
`(:eval (run-shell-command ,formatter t))
|
||||
(format nil "~A" formatter))
|
||||
(generate-modeline (cdr elements) (not not-invertedp)))))))
|
||||
#+end_src
|
||||
|
||||
It is then easy to define a command that can call this function and
|
||||
set this variable so we can sort of reload the mode-line.
|
||||
#+begin_src lisp
|
||||
(defcommand reload-modeline () ()
|
||||
"Reload modeline."
|
||||
(setf *screen-mode-line-format*
|
||||
(cdr (generate-modeline *mode-line-formatter-list*))))
|
||||
#+end_src
|
||||
(cdr (generate-modeline '<<modeline-format-gen()>>))))
|
||||
|
||||
And actually, let’s reload the modeline immediately.
|
||||
#+begin_src lisp
|
||||
(reload-modeline)
|
||||
#+end_src
|
||||
|
||||
** TODO Investigate why ~stumptray~ acts up :noexport:
|
||||
This variable as you can see is a list of elements, although here I am
|
||||
only using one string. But it is absolutely possible to insert some
|
||||
CLisp code in here that returns some string if the user needs some
|
||||
code to return data that cannot be easily accesible otherwise. I might
|
||||
add some at some point, but not today yet.
|
||||
|
||||
** TODO Investigate why ~stumptray~ doesn’t work :noexport:
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: Modeline-Investigate-why-stumptray-doesn-t-work-0juh13g0m6j0
|
||||
:END:
|
||||
Systray overlaps with the far-right part of the modeline.
|
||||
|
||||
# Also, let’s enable a system tray.
|
||||
# #+begin_src lisp
|
||||
|
|
Loading…
Reference in New Issue