All org dotfiles are now exportable as a website

This commit is contained in:
2020-01-15 12:38:29 +01:00
parent ca6cddcd2d
commit 2f45a783fe
17 changed files with 196 additions and 281 deletions

View File

@@ -1,36 +1,9 @@
#+TITLE: Phundraks fish config
#+AUTHOR: Lucien "Phundrak” Cartier-Tilet
#+EMAIL: lucien@phundrak.com
#+OPTIONS: H:4 broken_links:mark email:t ^:{} auto-id:t
#+EXPORT_FILE_NAME: index.html
# ### LaTeX ####################################################################
#+LATEX_CLASS: article
#+LaTeX_CLASS_OPTIONS: [a4paper,twoside]
#+LATEX_HEADER_EXTRA: \usepackage{xltxtra,xcolor,hyperref,indentfirst}
#+LATEX_HEADER_EXTRA: \usepackage[total={17cm,24cm}]{geometry}
#+LATEX_HEADER_EXTRA: \setmainfont{Charis SIL}
#+LATEX_HEADER_EXTRA: \hypersetup{colorlinks=true,linkbordercolor=red,linkcolor=blue,pdfborderstyle={/S/U/W 1}}
# ### HTML #####################################################################
#+HTML_DOCTYPE: html5
#+INCLUDE: ~/org/config-website/headers.org
#+OPTIONS: auto-id:t
#+HTML_HEAD_EXTRA: <meta name="description" content="Phundrak's fish config" />
#+HTML_HEAD_EXTRA: <meta property="og:title" content="Phundrak's fish config" />
#+HTML_HEAD_EXTRA: <meta property="og:description" content="Description of the fish config file of Phundrak" />
#+HTML_HEAD_EXTRA: <script src="https://kit.fontawesome.com/4d42d0c8c5.js"></script>
#+HTML_HEAD_EXTRA: <script src="https://cdn.jsdelivr.net/npm/js-cookie@2/src/js.cookie.min.js"></script>
#+HTML_HEAD_EXTRA: <link rel="shortcut icon" href="https://cdn.phundrak.com/img/mahakala-128x128.png" type="img/png" media="screen" />
#+HTML_HEAD_EXTRA: <link rel="shortcut icon" href="https://cdn.phundrak.com/img/favicon.ico" type="image/x-icon" media="screen" />
#+HTML_HEAD_EXTRA: <meta property="og:image" content="https://cdn.phundrak.com/img/rich_preview.png" />
#+HTML_HEAD_EXTRA: <meta name="twitter:card" content="summary" />
#+HTML_HEAD_EXTRA: <meta name="twitter:site" content="@phundrak" />
#+HTML_HEAD_EXTRA: <meta name="twitter:creator" content="@phundrak" />
#+HTML_HEAD_EXTRA: <style>.org-svg{width:auto}</style>
#+INFOJS_OPT: view:info toc:1 home:https://phundrak.com/config toc:t
#+HTML_HEAD_EXTRA: <link rel="stylesheet" href="https://langue.phundrak.com/css/htmlize.min.css"/>
#+HTML_HEAD_EXTRA: <link rel="stylesheet" href="https://langue.phundrak.com/css/main.css"/>
#+HTML_HEAD_EXTRA: <script src="https://langue.phundrak.com/js/jquery.min.js"></script>
#+HTML_HEAD_EXTRA: <script defer src="https://langue.phundrak.com/js/main.js"></script>
* Table of Contents :TOC_4_gh:noexport:
:PROPERTIES:
@@ -61,11 +34,12 @@
- [[#sudo][Sudo]]
- [[#exit][Exit]]
- [[#history][History]]
- [[#song-download-from-youtube][Song download from YouTube]]
- [[#youtube-dl-related-commands][~youtube-dl~ related commands]]
- [[#song-download-from-youtube][Song download from YouTube]]
- [[#videos-download-from-youtube][Videos download from YouTube]]
- [[#mpv][MPV]]
- [[#compression][Compression]]
- [[#feh][Feh]]
- [[#ls][ls]]
- [[#network-management][Network Management]]
- [[#wget][Wget]]
@@ -499,7 +473,6 @@
[[file:~/.local/bin/askpass][.local/bin/askpass]]). I also made it so =please= is an equivalent to =sudo
-A= as a joke.
#+BEGIN_SRC fish
abbr sudo 'sudo -A'
abbr please 'sudo -A'
#+END_SRC
@@ -522,15 +495,32 @@
abbr hist history
#+END_SRC
*** Song download from YouTube
*** ~youtube-dl~ related commands
:PROPERTIES:
:CUSTOM_ID: h-4bc663a9-b609-4c86-9a4d-a220013c67f9
:CUSTOM_ID: h-177d56dc-39a6-4f4c-a7ba-179dd5c6cac8
:END:
When I want to download a song from YouTube, Ill just use the command
=flac videoIdentifier= to get it through =youtube-dl=.
#+BEGIN_SRC fish
abbr flac 'youtube-dl -x --audio-format flac --audio-quality 0'
#+END_SRC
**** Song download from YouTube
:PROPERTIES:
:CUSTOM_ID: h-4bc663a9-b609-4c86-9a4d-a220013c67f9
:END:
When I want to download a song from YouTube, Ill just use the command
=flac videoIdentifier= to get it through =youtube-dl=.
#+BEGIN_SRC fish
abbr flac 'youtube-dl -x --audio-format flac --audio-quality 0 -o "~/Music/%(uploader)s/%(title)s.%(ext)s"'
#+END_SRC
**** Videos download from YouTube
:PROPERTIES:
:CUSTOM_ID: h-e6e45b59-7620-4d17-ba32-67a33f39cc4b
:END:
I download a LOT of videos from YouTube, generally educative videos that I
do not want to lose to YouTube one day who will decide that such channel is
unworthy of their platform, or if the original author decides to delete
their videos or whatever. So, I use the abbreviation ~ytdl~ to download
either one video, or a whole YouTube channel.
#+BEGIN_SRC fish
abbr ytdl 'youtube-dl -f best -ciw -o "~/Videos/YouTube/%(uploader)s/%(upload_date)s - %(title)s.%(ext)s"'
#+END_SRC
*** MPV
:PROPERTIES:
@@ -568,16 +558,6 @@
abbr feh 'feh -Zx.'
#+END_SRC
*** ls
:PROPERTIES:
:CUSTOM_ID: h-9980009d-3fc4-4e2e-861b-1af007212f8d
:END:
Yep, an abbreviation of =ls= called =lsl=. It allows me to view all the
files in a directory as a list with detailed, human-readable information.
#+BEGIN_SRC fish
abbr lsl 'ls -ahl'
#+END_SRC
*** Network Management
:PROPERTIES:
:CUSTOM_ID: h-5f9d4866-3086-4ed9-9ff3-d80a0af36593

View File

@@ -1,40 +1,10 @@
# -*- org-confirm-babel-evaluate: nil -*-
#+TITLE: Phundraks i3 config
#+AUTHOR: Lucien "Phundrak” Cartier-Tilet
#+EMAIL: lucien@phundrak.com
#+OPTIONS: H:4 email:t ^:{} auto-id:t
# ### LaTeX ####################################################################
#+LATEX_CLASS: article
#+LaTeX_CLASS_OPTIONS: [a4paper,twoside]
#+LATEX_HEADER_EXTRA: \usepackage{tocloft} \setlength{\cftchapnumwidth}{3em}
#+LATEX_HEADER_EXTRA: \usepackage{xltxtra,fontspec,xunicode,svg}
#+LATEX_HEADER_EXTRA: \usepackage[total={17cm,24cm}]{geometry}
#+LATEX_HEADER_EXTRA: \setromanfont{Charis SIL}
#+LATEX_HEADER_EXTRA: \usepackage{xcolor}
#+LATEX_HEADER_EXTRA: \usepackage{hyperref}
#+LATEX_HEADER_EXTRA: \hypersetup{colorlinks=true,linkbordercolor=red,linkcolor=blue,pdfborderstyle={/S/U/W 1}}
#+LATEX_HEADER_EXTRA: \usepackage{indentfirst}
# ### HTML #####################################################################
#+HTML_DOCTYPE: html5
#+INCLUDE: ~/org/config-website/headers.org
#+OPTIONS: auto-id:t
#+HTML_HEAD_EXTRA: <meta name="description" content="Phundrak's i3 config" />
#+HTML_HEAD_EXTRA: <meta property="og:title" content="Phundrak's i3 config" />
#+HTML_HEAD_EXTRA: <meta property="og:description" content="Description of the i3 config file of Phundrak" />
#+HTML_HEAD_EXTRA: <script src="https://kit.fontawesome.com/4d42d0c8c5.js"></script>
#+HTML_HEAD_EXTRA: <script src="https://cdn.jsdelivr.net/npm/js-cookie@2/src/js.cookie.min.js"></script>
#+HTML_HEAD_EXTRA: <link rel="shortcut icon" href="https://cdn.phundrak.com/img/mahakala-128x128.png" type="img/png" media="screen" />
#+HTML_HEAD_EXTRA: <link rel="shortcut icon" href="https://cdn.phundrak.com/img/favicon.ico" type="image/x-icon" media="screen" />
#+HTML_HEAD_EXTRA: <meta property="og:image" content="https://cdn.phundrak.com/img/rich_preview.png" />
#+HTML_HEAD_EXTRA: <meta name="twitter:card" content="summary" />
#+HTML_HEAD_EXTRA: <meta name="twitter:site" content="@phundrak" />
#+HTML_HEAD_EXTRA: <meta name="twitter:creator" content="@phundrak" />
#+HTML_HEAD_EXTRA: <style>.org-svg{width:auto}</style>
#+INFOJS_OPT: view:info toc:1 home:https://phundrak.com/config toc:t
#+HTML_HEAD_EXTRA: <link rel="stylesheet" href="https://langue.phundrak.com/css/htmlize.min.css"/>
#+HTML_HEAD_EXTRA: <link rel="stylesheet" href="https://langue.phundrak.com/css/main.css"/>
#+HTML_HEAD_EXTRA: <script src="https://langue.phundrak.com/js/jquery.min.js"></script>
#+HTML_HEAD_EXTRA: <script defer src="https://langue.phundrak.com/js/main.js"></script>
* Table of Contents :TOC_4_gh:noexport:
:PROPERTIES:
@@ -134,6 +104,8 @@
| $term | st |
#+NAME: variable-sh
| variable | value |
|-------------+--------------------------------------------------------------------------|
| $exiti3 | i3-nagbar -t warning -m 'Leave i3?' -b 'Yes' 'i3-msg exit' |
| $lockscreen | Lucien Cartier-Tilet\n(Phuntsok Drak-pa)\n+33 (0)6 83 90 56 89 |
| $rofiexec | rofi -combi-modi 'window,drun' -show combi -mohh combi -m -1 -show-icons |
@@ -150,18 +122,18 @@
#+BEGIN_SRC python :var variables=variable-table :cache yes
result = ''
for line in variables:
result += "set {0}\t{1}\n".format(line[0], line[1])
result += "set {0} {1}\n".format(line[0], line[1])
return result
#+END_SRC
#+RESULTS[daefb71e1df094fad8f60b95c8b00730d5110ae3]: generate-variables
: set $mod Mod4
: set $alt Mod1
: set $up Up
: set $down Down
: set $left Left
: set $right Right
: set $term st
#+RESULTS[58c517fe29b63f631ff0ba754d5d9ec4ea673388]: generate-variables
: set $mod Mod4
: set $alt Mod1
: set $up Up
: set $down Down
: set $left Left
: set $right Right
: set $term st
Finally, some variables hold some long strings for commands I dont want to
have to type multiple times.
@@ -169,17 +141,17 @@
#+BEGIN_SRC python :var variables=variable-sh :cache yes
result = ''
for line in variables:
result += "set {0}\t\"{1}\"\n".format(line[0], line[1])
result += "set {0} \"{1}\"\n".format(line[0], line[1])
return result
#+END_SRC
#+RESULTS[caa4fad487ab743e5398c357542b25eaa2b792cf]: generate-variables2
: set $exiti3 "i3-nagbar -t warning -m "Leave i3?" -b "Yes" "i3-msg exit""
: set $lockscreen "Lucien Cartier-Tilet\n(Phuntsok Drak-pa)\n+33 (0)6 83 90 56 89"
: set $rofiexec "rofi -combi-modi "window,drun" -show combi -mohh combi -m -1 -show-icons"
: set $gnus "emacsclient --create-frame --eval "(gnus)" -n"
: set $ec "emacsclient --create-frame -n"
: set $walset "wal -i ~/Pictures/Wallpapers -o wal-set"
#+RESULTS[13a3244099ec9233a8b7003c1874b3c92cb19e34]: generate-variables2
: set $exiti3 "i3-nagbar -t warning -m 'Leave i3?' -b 'Yes' 'i3-msg exit'"
: set $lockscreen "Lucien Cartier-Tilet\n(Phuntsok Drak-pa)\n+33 (0)6 83 90 56 89"
: set $rofiexec "rofi -combi-modi 'window,drun' -show combi -mohh combi -m -1 -show-icons"
: set $gnus "emacsclient --create-frame --eval '(gnus)' -n"
: set $ec "emacsclient --create-frame -n"
: set $walset "wal -i ~/Pictures/Wallpapers -o wal-set"
Here is the configuration:
#+BEGIN_SRC conf :noweb yes
@@ -319,7 +291,7 @@
* Assigning windows to workspaces
:PROPERTIES:
:CUSTOM_ID: h-21870449-7730-4164-8add-167cb4e75218
:HEADER-ARGS: :exports code
:HEADER-ARGS: :exports code :tangle config##yadm.j2
:HEADER-ARGS:python: :exports none :tangle no
:END:
I decided to bind some windows to some workspaces in order to have a better
@@ -340,7 +312,7 @@
The class table is used in the assignment in the i3 config file. For instance,
Gimps assignment will look like this:
#+BEGIN_SRC conf
#+BEGIN_SRC conf :tangle no
assign [class="Gimp*"] 6
#+END_SRC
@@ -353,7 +325,7 @@
#+END_SRC
Here is the configuration:
#+BEGIN_SRC conf :noweb yes :tangle config##yadm.j2
#+BEGIN_SRC conf :noweb yes
<<generate-workspaces()>>
#+END_SRC
@@ -362,7 +334,7 @@
have two screens — and since this is the case when I am using only one
computer, Marpa, I can make it a conditional thanks to yadms jinja2 syntax.
#+BEGIN_SRC conf :tangle config##yadm.j2
#+BEGIN_SRC conf
{% if YADM_HOSTNAME == 'Marpa' -%}
workspace 10 output eDP-1
{% endif -%}
@@ -386,7 +358,7 @@
#+BEGIN_SRC python :exports none :var table=[] :eval yes :tangle no
results = ''
for line in table:
results += "bindsym {0}\t{1}\n".format(line[0], line[1])
results += "bindsym {0} {1}\n".format(line[0], line[1])
return results
#+END_SRC
@@ -763,7 +735,7 @@
#+NAME: internet-sh
| shortcut | command | what it does |
|--------------+---------------------+-----------------------------|
| $mod+c | exec firefox | Launch firefox |
| $mod+b | exec firefox | Launch browser |
| $mod+m | exec $gnus | Launch Gnus, my mail client |
| Ctrl+Shift+d | exec discord-canary | Launch Discord |
@@ -913,7 +885,7 @@
#+BEGIN_SRC conf
{% if YADM_HOSTNAME == 'Marpa' -%}
bindsym $mod+Ctrl+p xrandr --output HDMI-1 --mode 1024x768 --right-of eDP-1
{% else %}
{% else -%}
bindsym $mod+Ctrl+p xrandr --output VGA1 --mode 1024x768 --right-of LVDS1
{% endif -%}
#+END_SRC