Compare commits

..

34 Commits

Author SHA1 Message Date
1e0da1267f Update CLAUDE.md: simplify tangle command to use emacsclient 2026-03-09 09:59:58 +01:00
fe12a4404b Update miscellaneous configs 2026-03-09 09:27:31 +01:00
c9d59c744f Update git config 2026-03-09 09:27:31 +01:00
a6e4629965 Update music config (mopidy, ncmpcpp) 2026-03-09 09:27:31 +01:00
d8208d3390 Update calendar and contacts config (vdirsyncer, khal, khard) 2026-03-09 09:27:31 +01:00
1b61b86518 Update Neovim config 2026-03-09 09:27:31 +01:00
f106352e40 Update i3, sxhkd, picom and Xorg config 2026-03-09 09:27:31 +01:00
f85ccc9dfb Update bash and tmux config 2026-03-09 09:27:31 +01:00
d35c790c9e Update install instructions 2026-03-09 09:27:31 +01:00
98053491b3 Update scripts in ~/.local/bin/ 2026-03-09 09:27:31 +01:00
eacecdd006 Update qutebrowser config and userscripts 2026-03-09 09:27:31 +01:00
ab544fa439 Update polybar config and scripts 2026-03-09 09:27:31 +01:00
df3a9879f3 Update homelab docker and server config 2026-03-09 09:27:31 +01:00
e7b3b3d37e Update mail config (mbsync, msmtp, neomutt) 2026-03-09 09:27:31 +01:00
ce13adc1d3 Update Doom Emacs config, snippets and babel library 2026-03-09 09:27:31 +01:00
2e8b8b97d9 Add yazi file manager config 2026-03-09 09:27:31 +01:00
b6e07b3cb5 Replace alacritty with kitty, add squeezelite config 2026-03-09 09:27:31 +01:00
9622d60ff9 Add CLAUDE.md with repository guidance 2026-03-09 09:27:31 +01:00
3cec8270c9 Update polybar tray 2024-05-03 16:35:09 +02:00
5c53288d3b Correct typo 2024-01-29 11:31:11 +01:00
9e25501b41 Minor modifications 2024-01-29 11:28:50 +01:00
cc71e4c758 Add backup server config, remove smartTV computer 2024-01-29 11:28:12 +01:00
b2b1f83c98 Update alacritty from yml to toml config 2024-01-29 11:27:23 +01:00
bd9681e182 Update remote to ESRF computers 2024-01-29 11:27:09 +01:00
3257e8e9e1 Be able to use i3 bindings when remote-desktop 2024-01-29 11:26:40 +01:00
174486fd0b Have i3 bindings outside sxhkd
There was an issue about correct focus of window
2024-01-29 11:26:04 +01:00
10208a2d65 New configuration for double screen 2024-01-29 11:25:48 +01:00
f8070f6e51 update theme 2023-10-13 12:30:13 +02:00
9346aee86d Huge change about matrix.
Change some termination to be compatible with ansible-matrix:
https: web-secure
http: web
2023-03-08 10:02:55 +01:00
25cce2363d Remove -bibtex for pdfexport using latemk 2023-02-07 10:56:07 +01:00
a21fd82d83 Add shortcuts for notifications 2022-05-17 14:00:28 +02:00
8ec712d76d Change from tremc to stig 2022-05-17 13:59:54 +02:00
d1bd245ed2 Rework mopidy 2022-05-17 13:57:54 +02:00
999737eb86 Add bluetooth applet 2022-05-17 13:57:05 +02:00
50 changed files with 9774 additions and 5622 deletions

93
CLAUDE.md Normal file
View File

@@ -0,0 +1,93 @@
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Overview
This is a **literate dotfiles** repository. All configuration is written in Org-mode files (`.org`), which are then **tangled** (extracted) into actual config files placed at their target paths on the filesystem (e.g., `~/.bashrc`, `~/.config/doom/config.el`).
## How Tangling Works
Each `.org` file contains source code blocks like:
```org
#+begin_src bash :tangle ~/.bashrc :comments both :mkdirp yes
# shell code here
#+end_src
```
The `:tangle <path>` header arg specifies the destination file. When tangled from Emacs, the code blocks are extracted and written to those paths.
**To tangle a single file:**
```bash
emacsclient -e '(org-babel-tangle-file "/home/thomas/.config/literate-dotfiles/file.org")'
```
## Key Conventions
- **`#+SETUPFILE: ./setup/org-setup-file.org`** — shared HTML export settings, included at the top of most files
- **`:noweb yes`** — some blocks use noweb references like `<<get-password(passname="...")>>` which calls named blocks from `emacs-library-babel.org` to fetch passwords from `pass`
- **`:tangle-mode (identity #o600)`** — some sensitive files (e.g., `~/.netrc`, `~/.smbcredentials`) are tangled with restricted permissions
- **`:mkdirp yes`** — automatically creates the target directory if missing
- **`:comments both`** — inserts org link comments into the tangled output so you can navigate back to the source
## Library of Babel (`emacs-library-babel.org`)
Defines reusable named blocks:
- `get-password` — retrieves a secret from `pass` (the password store)
- `pdf2svg` — converts PDF figures to SVG/PNG
- `addhdr` — adds hline to org tables
This file must be loaded in Emacs (via `org-babel-lob-ingest`) for noweb calls to `<<get-password(...)>>` to work during tangling.
## HTML Documentation (`docs/`)
The `.org` files can also be exported to HTML (stored in `docs/`). The `setup/org-setup-file.org` configures the HTML theme. Pre-built HTML is already present; regenerate with `M-x org-export-dispatch` → HTML in Emacs.
## File Map
Each `.org` file corresponds to a tool/topic and tangles to one or more config files:
| File | Tangles to |
|------|-----------|
| `applications.org` | `~/.config/mimeapps.list`, `~/.local/share/applications/*.desktop` |
| `bash.org` | `~/.bashrc`, `~/.bash_profile`, `~/.profile`, `~/.config/readline/inputrc` |
| `binaries.org` | Scripts in `~/.local/bin/` |
| `binaries-private.org` | Private/work scripts in `~/.local/bin/` |
| `calendar-contact.org` | `~/.config/vdirsyncer/`, `~/.config/khal/`, `~/.config/khard/` |
| `compositor.org` | `~/.config/picom/picom.conf` |
| `config.org` | `~/.ssh/config`, `~/.XCompose`, `~/.config/fontconfig/`, `~/.netrc`, `~/.smbcredentials`, etc. |
| `doom.org` | `~/.config/doom/config.el`, `init.el`, `packages.el` |
| `emacs-snippets.org` | `~/.config/doom/snippets/` |
| `git.org` | `~/.config/git/config`, `~/.config/pass-git-helper/` |
| `homelab.org` | Remote files on homelab via TRAMP (`/ssh:thomas@homelab:…`) |
| `i3.org` | `~/.config/i3/config` |
| `image.org` | `~/.config/nsxiv/exec/key-handler` |
| `kitty.org` | `~/.config/kitty/kitty.conf` |
| `mail.org` | `~/.config/isync/`, `~/.config/msmtp/`, `~/.config/neomutt/` |
| `matlab.org` | `~/.config/matlab/startup.m`, `~/.config/matlab/setup.m` |
| `music.org` | `~/.config/mopidy/`, `~/.config/ncmpcpp/` |
| `polybar.org` | `~/.config/polybar/config.ini`, `~/.config/polybar/scripts/` |
| `qutebrowser.org` | `~/.config/qutebrowser/config.py`, `~/.config/qutebrowser/userscripts/` |
| `ranger.org` | `~/.config/ranger/` |
| `sxhkd.org` | `~/.config/sxhkd/sxhkdrc` |
| `systemd.org` | `~/.config/systemd/user/` units and associated scripts in `~/.local/bin/` |
| `tablet.org` | Xournal++ toolbar, Huion tablet setup scripts |
| `tmux.org` | `~/.config/tmux/tmux.conf` |
| `torrent.org` | `~/.config/stig/rc`, `~/.config/aria2/` |
| `vim.org` | `~/.config/nvim/init.vim` |
| `xconfig.org` | `~/.Xresources`, `~/.config/X11/xinitrc`, `~/.xprofile` |
| `yazi.org` | `~/.config/yazi/` |
| `android.org` | Documentation only (no tangle) |
| `backup.org` | Documentation only (no tangle) |
| `maintenance.org` | Documentation only (no tangle) |
| `router.org` | Documentation only (no tangle) |
| `squeezelite.org` | Documentation only (no tangle) |
## Doom Emacs Notes
When modifying `doom.org` (which tangles `init.el` or `packages.el`), after tangling run:
```bash
doom sync
```
Then restart Emacs with `SPC q r`.

View File

@@ -1,73 +0,0 @@
#+TITLE: Alacritty Configuration
#+SETUPFILE: ./setup/org-setup-file.org
#+PROPERTY: header-args+ :comments none
#+PROPERTY: header-args+ :mkdirp yes
#+PROPERTY: header-args+ :tangle ~/.config/alacritty/alacritty.yml
* Fonts
#+begin_src yaml
font:
normal:
family: Hack Nerd Font Mono
style: Regular
bold:
family: Hack Nerd Font Mono
style: Bold
italic:
family: Hack Nerd Font Mono
style: Italic
bold_italic:
family: Hack Nerd Font Mono
style: Bold Italic
size: 10.0
#+end_src
* Colors
#+begin_src yaml
colors:
primary:
background: &gruvbox_dark_bg '#32302f'
foreground: '#fbf1c7'
bright_foreground: '#f9f5d7'
dim_foreground: '#f2e5bc'
cursor:
text: CellBackground
cursor: CellForeground
vi_mode_cursor:
text: CellBackground
cursor: CellForeground
selection:
text: CellBackground
background: CellForeground
bright:
black: '#928374'
red: '#fb4934'
green: '#b8bb26'
yellow: '#fabd2f'
blue: '#83a598'
magenta: '#d3869b'
cyan: '#8ec07c'
white: '#ebdbb2'
normal:
black: *gruvbox_dark_bg
red: '#cc241d'
green: '#98971a'
yellow: '#d79921'
blue: '#458588'
magenta: '#b16286'
cyan: '#689d6a'
white: '#a89984'
dim:
black: '#32302f'
red: '#9d0006'
green: '#79740e'
yellow: '#b57614'
blue: '#076678'
magenta: '#8f3f71'
cyan: '#427b58'
white: '#928374'
#+end_src

View File

@@ -63,7 +63,6 @@ Tutorial: https://www.youtube.com/watch?v=3pxOeiIBrHI
| [[https://github.com/erickok/transdroid][Transdroid]] | https://f-droid.org/en/packages/org.transdroid.full/ | Transmission and Aria2 clients |
| [[https://github.com/AntennaPod/AntennaPod][AntennaPod]] | https://f-droid.org/packages/de.danoeh.antennapod/ | Podcast manager |
| [[https://github.com/bromite/bromite][Bromite]] | | Chromium fork with ad blocking and privacy enhancements |
| [[https://github.com/Jays2Kings/tachiyomiJ2K][TachiyomiJ2K]] | | Manga reader |
| [[https://github.com/DocMarty84/miniflutt][Miniflutt]] | | Miniflux client |

View File

@@ -3,138 +3,75 @@
#+PROPERTY: header-args:conf :comments none :mkdirp yes
* Mime Applications
:PROPERTIES:
:header-args: :tangle ~/.config/mimeapps.list
:END:
#+BEGIN_SRC conf
#+BEGIN_SRC conf :tangle ~/.config/mimeapps.list
[Default Applications]
text/plain=nvim.desktop
x-scheme-handler/magnet=torrent.desktop;
text/x-shellscript=nvim.desktop;
image/png=img.desktop;
image/jpeg=img.desktop;
image/gif=img.desktop;
text/x-tex=emacsclient.desktop
text/x-shellscript=nvim.desktop
image/png=img.desktop
image/jpeg=img.desktop
image/gif=img.desktop
image/svg+xml=inkscape.desktop
application/rss+xml=rss.desktop
x-scheme-handler/mailto=neomutt.desktop
message/rfc822=neomutt.desktop
application/x-bittorrent=deluge.desktop
x-scheme-handler/magnet=stig.desktop;
application/x-bittorrent=stig.desktop
application/pdf=zathura.desktop
x-scheme-handler/http=qutebrowser.desktop
x-scheme-handler/https=qutebrowser.desktop
x-scheme-handler/ftp=qutebrowser.desktop
x-scheme-handler/chrome=qutebrowser.desktop
text/html=qutebrowser.desktop
application/x-extension-htm=qutebrowser.desktop
application/x-extension-html=qutebrowser.desktop
application/x-extension-shtml=qutebrowser.desktop
application/xhtml+xml=qutebrowser.desktop
application/x-extension-xhtml=qutebrowser.desktop
application/x-extension-xht=qutebrowser.desktop
text/xml=org.qutebrowser.qutebrowser.desktop
text/html=org.qutebrowser.qutebrowser.desktop
x-scheme-handler/http=org.qutebrowser.qutebrowser.desktop
x-scheme-handler/https=org.qutebrowser.qutebrowser.desktop
x-scheme-handler/ftp=org.qutebrowser.qutebrowser.desktop
x-scheme-handler/chrome=org.qutebrowser.qutebrowser.desktop
application/x-extension-htm=org.qutebrowser.qutebrowser.desktop
application/x-extension-html=org.qutebrowser.qutebrowser.desktop
application/x-extension-shtml=org.qutebrowser.qutebrowser.desktop
application/xhtml+xml=org.qutebrowser.qutebrowser.desktop
application/x-extension-xhtml=org.qutebrowser.qutebrowser.desktop
application/x-extension-xht=org.qutebrowser.qutebrowser.desktop
x-scheme-handler/about=org.qutebrowser.qutebrowser.desktop
x-scheme-handler/unknown=org.qutebrowser.qutebrowser.desktop
application/msword=onlyoffice-desktopeditors.desktop
application/vnd.ms-excel=onlyoffice-desktopeditors.desktop
application/vnd.ms-powerpoint=onlyoffice-desktopeditors.desktop
application/vnd.openxmlformats-officedocument.wordprocessingml.document=onlyoffice-desktopeditors.desktop
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet=onlyoffice-desktopeditors.desktop
application/vnd.openxmlformats-officedocument.presentationml.presentation=onlyoffice-desktopeditors.desktop
text/calendar=ics_add.desktop
[Added Associations]
text/plain=mousepad.desktop;
application/x-bittorrent=deluge.desktop;
application/x-bittorrent=stig.desktop;
#+END_SRC
* Neomutt
:PROPERTIES:
:header-args: :tangle ~/.local/share/applications/neomutt.desktop
:END:
#+begin_src conf
* Inkscape
#+begin_src conf :tangle ~/.local/share/applications/inkscape.desktop
[Desktop Entry]
Name=Neomutt
GenericName=Email client
Exec=$TERMINAL -e neomutt %u
Type=Application
Icon=/usr/share/icons/Papirus/64x64/apps/mutt.svg
Categories=Network;Email;
MimeType=message/rfc822;x-scheme-handler/mailto;application/x-xpinstall;
StartupNotify=true
#+end_src
* Matlab
:PROPERTIES:
:header-args: :tangle ~/.local/share/applications/matlab.desktop
:END:
#+begin_src conf
[Desktop Entry]
Version=R2020b
Version=1.0
Name=Inkscape
Type=Application
Categories=Graphics;VectorGraphics;GTK;
MimeType=image/svg+xml;image/svg+xml-compressed;application/vnd.corel-draw;application/pdf;application/postscript;image/x-eps;application/illustrator;
Exec=inkscape %F
TryExec=inkscape
Terminal=false
MimeType=text/x-matlab
Exec=/home/thomas/.local/bin/matlab -desktop
Name=MATLAB
Icon=matlab
Categories=Development;Math;Science
Comment=Scientific computing environment
StartupNotify=true
Icon=inkscape
X-Ayatana-Desktop-Shortcuts=Drawing
#+end_src
* Neovim
:PROPERTIES:
:header-args: :tangle ~/.local/share/applications/nvim.desktop
:END:
#+begin_src conf
[Desktop Entry]
Name=Neovim
GenericName=Text Editor
Comment=Edit text files
Exec=nvim %F
Terminal=true
Type=Application
Keywords=Text;editor;
Icon=/usr/share/icons/Papirus/48x48/apps/nvim.svg
Categories=Utility;TextEditor;
StartupNotify=false
MimeType=text/english;text/plain;text/x-makefile;
#+end_src
* Images
:PROPERTIES:
:header-args: :tangle ~/.local/share/applications/img.desktop
:END:
#+begin_src conf
[Desktop Entry]
Type=Application
Name=Image viewer
Exec=/usr/bin/sxiv -a %u
#+end_src
* Org-Protocol
:PROPERTIES:
:header-args: :tangle ~/.local/share/applications/org-protocol.desktop
:END:
#+begin_src conf
[Desktop Entry]
Name=org-protocol
Exec=emacsclient %u
Icon=emacs-icon
Type=Application
Terminal=false
MimeType=x-scheme-handler/org-protocol;
#+end_src
* Ranger
:PROPERTIES:
:header-args: :tangle ~/.local/share/applications/ranger.desktop
:END:
#+begin_src conf
[Desktop Entry]
Type=Application
Name=ranger
Comment=Launches the ranger file manager
Icon=utilities-terminal
Terminal=true
Exec=ranger
Categories=ConsoleOnly;System;FileTools;FileManager
MimeType=inode/directory;inode/mount-point;x-scheme-handler/ssh;x-scheme-handler/smb;x-scheme-handler/nfs;x-scheme-handler/ftp;
#+end_src
* Emacs Client
:PROPERTIES:
:header-args: :tangle ~/.local/share/applications/emacsclient.desktop
:END:
#+begin_src conf
#+begin_src conf :tangle ~/.local/share/applications/emacsclient.desktop
[Desktop Entry]
Name=Emacs Client
GenericName=Text Editor
@@ -147,32 +84,62 @@ Terminal=false
Categories=Utility;TextEditor;
#+end_src
* Qutebrowser
* Neomutt
#+begin_src conf :tangle ~/.local/share/applications/neomutt.desktop
[Desktop Entry]
Name=Neomutt
GenericName=Email client
Exec=kitty -e neomutt %u
Type=Application
Icon=/usr/share/icons/Papirus/64x64/apps/mutt.svg
Categories=Network;Email;
MimeType=message/rfc822;x-scheme-handler/mailto;application/x-xpinstall;
StartupNotify=true
#+end_src
* Matlab
#+begin_src conf :tangle ~/.local/share/applications/matlab.desktop
[Desktop Entry]
Version=R2019b
Type=Application
Terminal=false
MimeType=text/x-matlab
Exec=/home/thomas/.local/bin/matlab -desktop
Name=MATLAB
Icon=matlab
Categories=Development;Math;Science
Comment=Scientific computing environment
StartupNotify=true
#+end_src
* Images
:PROPERTIES:
:header-args: :tangle ~/.local/share/applications/qutebrowser.desktop
:header-args: :tangle ~/.local/share/applications/img.desktop
:END:
#+begin_src conf
[Desktop Entry]
Name=qutebrowser
StartupWMClass=qutebrowser
GenericName=Web Browser
Comment=A keyboard-driven, vim-like browser based on PyQt5
Icon=qutebrowser
Type=Application
Categories=Network;WebBrowser;
Exec=qutebrowser %u
Name=Image viewer
Exec=/home/thomas/.local/bin/nsxiv-rifle %u
#+end_src
* Org-Protocol
#+begin_src conf :tangle ~/.local/share/applications/org-protocol.desktop
[Desktop Entry]
Name=org-protocol
Exec=emacsclient %u
Icon=emacs-icon
Type=Application
Terminal=false
StartupNotify=true
MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/qute;
Keywords=Browser
Actions=new-window;preferences;
MimeType=x-scheme-handler/org-protocol;
#+end_src
* Zathura
:PROPERTIES:
:header-args: :tangle ~/.local/share/applications/zathura.desktop
:END:
#+begin_src conf
#+begin_src conf :tangle ~/.local/share/applications/zathura.desktop
[Desktop Entry]
Version=1.0
Type=Application
@@ -184,3 +151,29 @@ Terminal=false
Categories=Office;Viewer;
MimeType=application/pdf;
#+end_src
* Stig
#+begin_src conf :tangle ~/.local/share/applications/stig.desktop
[Desktop Entry]
Name=Stig
Comment=TUI and CLI for Transmission
Terminal=true
Exec=torrent-add %U
Type=Application
MimeType=application/x-bittorrent
Categories=Network;FileTransfer;P2P;
Keywords=p2p;bittorrent;transmission;rpc;
#+end_src
* ICS-Add
#+begin_src conf :tangle ~/.local/share/applications/ics_add.desktop
[Desktop Entry]
Name=ICS Add
Comment=Add ICS file to the calendar
Terminal=true
Exec=ics-add %U
Type=Application
MimeType=text/calendar
#+end_src

73
backup.org Normal file
View File

@@ -0,0 +1,73 @@
#+TITLE: Backup Strategy
#+SETUPFILE: ./setup/org-setup-file.org
* Laptop Backup
** =Cloud= directory: =syncthing=
Backup using =syncthing= on the =homelab=.
** =home= directory: =restic=
=restic-backup= systemd service ([[file:systemd.org::*=restic-backup= - Backup Home Directory][here]]).
It backups all the home directory, except for the =Cloud= directory (taken care by =syncthing=).
This is in the =homelab= in =/srv/storage/Backups/esrf-laptop=.
** How to access backed up data ?
=restic mount ~/mnt/backup/=
Then go to =~/mnt/backup/snapshots=, and look for the wanted files.
* Homelab Backup
** Backup Strategy
The following directories are backup on the =Odroid HC4= machine:
- =/home/thomas= that mainly contains the *docker configuration*
- =Users= that contains the Cloud of all users
- =Cloud= that contains my own cloud
- =Music= that contains all the music library
- =immich= that contains all pictures
What is *not* backed up:
- Most of multimedia content: =Animes=, =Books=, =Conferences=, =Documentaries=, =Games=, =Scans=, =StandUp=, =LiveMusic=, =Movies=, =Trainings=, =TVShows=
- The =Downloads= directory
** How to access backed up data ?
First, the =Odroid HC4= server needs to be powered on.
To list backups:
#+begin_src bash :dir /ssh:thomas@homelab:/ :results output replace
docker exec restic-hc4 restic snapshots
#+end_src
Force backup of folder:
#+begin_src bash :dir /ssh:thomas@homelab:/ :results output replace
docker exec restic-hc4 restic backup /data/documents/manuals
#+end_src
Find the path to the file within the snapshot:
#+begin_src bash :dir /ssh:thomas@homelab:/ :results output replace
docker exec restic-hc4 restic find file_name
#+end_src
Find files only for a specific snapshot:
#+begin_src bash :dir /ssh:thomas@homelab:/ :results output replace
docker exec restic-hc4 restic find -s latest file_name
#+end_src
Restore files/folders (replace file/folders):
#+begin_src bash :dir /ssh:thomas@homelab:/ :results output replace
docker exec restic-hc4 restic restore --include /data/documents/manuals --target / 088e31a4
#+end_src
You can use =latest= instead of the ID.
If indeed, we want to make a copy of the file, we can use the backup folder
#+begin_src bash :dir /ssh:thomas@homelab:/ :results output replace
docker exec restic-hc4 restic restore --include /data/documents/manuals --target /backup 088e31a4
#+end_src
* TODO [#C] Android backup
https://www.plop.at/en/lineageos.html

107
bash.org
View File

@@ -19,10 +19,16 @@
[ -r /usr/share/bash-completion/bash_completion ] && . /usr/share/bash-completion/bash_completion
#+END_SRC
** Miniconda
#+begin_src bash
[ -f /opt/miniconda3/etc/profile.d/conda.sh ] && source /opt/miniconda3/etc/profile.d/conda.sh
#+end_src
** FZF
#+begin_src bash
. /usr/share/doc/fzf/examples/completion.bash
. /usr/share/doc/fzf/examples/key-bindings.bash
. /usr/share/fzf/completion.bash
. /usr/share/fzf/key-bindings.bash
#+end_src
** Ignore case for auto-completion
@@ -78,6 +84,11 @@ bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'
#+END_SRC
** Kitty for SSH
#+begin_src bash
[ "$TERM" = "xterm-kitty" ] && alias ssh="kitty +kitten ssh"
#+end_src
** Aliases
*** Better defaults for some commands
#+BEGIN_SRC bash
@@ -86,14 +97,18 @@ alias grep='grep --colour=auto'
alias cp="cp -i" # confirm before overwriting something
alias df='df -h' # human-readable sizes
alias free='free -m' # show sizes in MB
alias bat='batcat'
alias mutt="neomutt"
#+END_SRC
Change default configuration file location:
#+BEGIN_SRC bash
alias tmux='tmux -f $XDG_CONFIG_HOME/tmux/tmux.conf'
alias mbsync='mbsync -c $XDG_CONFIG_HOME/isync/mbsyncrc'
#+END_SRC
*** One letter aliases
#+BEGIN_SRC bash
alias r="ranger"
alias y="yazi"
alias t="tmux"
alias v="nvim"
alias sv='sudo -E nvim'
@@ -118,11 +133,6 @@ alias :e=nvim
alias path='echo -e ${PATH//:/\\n}'
#+END_SRC
*** Other
#+begin_src bash
alias fd="fdfind"
#+end_src
** Functions
*** =colors= - Display colors
#+BEGIN_SRC bash
@@ -228,6 +238,11 @@ Force prompt to write history after every command. http://superuser.com/question
PROMPT_COMMAND="history -a; $PROMPT_COMMAND"
#+END_SRC
** Zoxide
#+BEGIN_SRC bash
eval "$(zoxide init bash)"
#+end_src
* =~/.bash_profile=
:PROPERTIES:
:header-args:bash: :tangle ~/.bash_profile
@@ -250,7 +265,7 @@ PROMPT_COMMAND="history -a; $PROMPT_COMMAND"
** QT And GTK Themes
#+begin_src bash
export QT_QPA_PLATFORMTHEME="qt5ct"
export GTK2_RC_FILES="$HOME/.gtkrc-2.0"
export GTK2_RC_FILES="$HOME/.config/gtk-2.0/gtkrc.mine"
#+END_SRC
** Gui program to ask for sudo password
@@ -258,28 +273,38 @@ export GTK2_RC_FILES="$HOME/.gtkrc-2.0"
export SUDO_ASKPASS=~/.local/bin/askpass-rofi
#+END_SRC
** Gnome Keyring Daemon
Enable the keyring for applications run through the terminal
#+begin_src bash
if [ -n "$DESKTOP_SESSION" ];then
eval $(gnome-keyring-daemon --start)
export SSH_AUTH_SOCK
fi
#+end_src
** Export some default applications
#+begin_src bash
export EDITOR="nvim"
export TERMINAL="alacritty"
export TERMINAL="kitty -1"
export BROWSER="qutebrowser"
export READER="zathura"
export FILE="ranger"
export FILE="yazi"
#+END_SRC
** Exports
*** XDG Default
#+begin_src bash
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_STATE_HOME="$HOME/.local/state"
export XDG_CACHE_HOME="$HOME/.cache"
#+end_src
#+begin_src bash
export XCURSOR_SIZE=24
#+end_src
#+begin_src bash
export LESSHISTFILE=-
export GNUPGHOME="$XDG_DATA_HOME/gnupg"
export _JAVA_OPTIONS=-Djava.util.prefs.userRoot="$XDG_CONFIG_HOME/java"
export PASSWORD_STORE_DIR="$XDG_DATA_HOME/pass"
export INPUTRC="$XDG_CONFIG_HOME/readline/inputrc"
export XINITRC="$XDG_CONFIG_HOME/X11/xinitrc"
export CARGO_HOME="$XDG_DATA_HOME/cargo"
export GTK2_RC_FILES="$XDG_CONFIG_HOME/gtkrc-2.0"
export MATLAB_LOG_DIR="$XDG_CACHE_HOME/matlab"
#+end_src
*** Use Ripgrep for FZF
@@ -288,37 +313,39 @@ export FZF_DEFAULT_COMMAND='rg --files --no-ignore --hidden --follow --glob "!.g
export FZF_DEFAULT_OPTS='--layout=reverse --height=20'
#+end_src
*** Goland
#+begin_src bash
export GOPATH=$HOME/go
#+end_src
*** Latex Path
#+begin_src bash
export TEXMFHOME=$HOME/.local/share/texmf
#+end_src
*** Python Path
#+begin_src bash
export PYTHONPATH="${PYTHONPATH}:/usr/lib/python3.9/site-packages/configobj"
#+end_src
*** Linkding
#+begin_src bash
export LINKDING_URL=`pass nas/linkding_url`
export LINKDING_TOKEN=`pass nas/linkding_token`
#+end_src
*** Restic
#+begin_src bash
export RESTIC_REPOSITORY=sftp:thomas@homelab:/srv/storage/Backups/esrf-laptop
export RESTIC_PASSWORD_COMMAND="pass show restic"
#+end_src
*** Go
#+begin_src bash
export GOPATH=$HOME/.config/go
#+end_src
*** Japanese input
#+begin_src bash
# Japanese input
export QT_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx
export GTK_IM_MODULE=fcitx
#+end_src
** Path
#+begin_src bash
PATH=$HOME/appimages:$PATH
PATH=$HOME/.gem/ruby/2.5.0/bin:$PATH
PATH=$GOPATH:$GOPATH/bin:$PATH
PATH=~/.config/emacs/bin:$PATH
PATH=~/.local/bin:$PATH
PATH=~/.local/bin/nvim/bin:$PATH
PATH=~/.npm-global/bin:$PATH
PATH=~/miniconda3/bin:$PATH
export PATH
#+END_SRC
@@ -329,9 +356,9 @@ if [ -z "${DISPLAY}" ] && [ "${XDG_VTNR}" -eq 1 ]; then
fi
#+end_src
* =~/.inputrc=
* =inputrc=
:PROPERTIES:
:header-args: :tangle ~/.inputrc
:header-args: :tangle ~/.config/readline/inputrc
:header-args+: :comments both :mkdirp yes
:CUSTOM_ID: inputrc
:END:

View File

@@ -10,16 +10,57 @@
:CUSTOM_ID: phonebook
:END:
The phone-list is taken from =scp opid21@lid21nano:/mnt/multipath-shares/sware/pub/phonelist/share/annuaire.txt /home/thomas/.local/data/annuaire.txt=
*Old phonebook*: The phone-list is taken from =scp rnice@esrf.fr:/mnt/multipath-shares/sware/pub/phonelist/share/annuaire.txt /home/thomas/.local/data/annuaire.txt=
*new phonebook*: Use the =etd= script
#+begin_src bash :tangle ~/.local/bin/phonebook
cat ~/.local/data/annuaire.txt | fzf --header="NAME Phone Box department roomNumber description mail"
cat ~/.local/data/annuaire.txt | fzf --header="NAME Surname Phone Office Room Email"
#+end_src
#+begin_src bash :tangle ~/.local/bin/phonebook-gui
$TERMINAL --title esrf-phonebook -e phonebook
#+end_src
#+begin_src bash :tangle ~/.local/bin/etd
#!/bin/bash
ROOT_URL='https://phonedirectory.esrf.fr'
API_ENDPOINT="$ROOT_URL/api"
USAGE="
ESRF Telephone Directory
CLI to search $ROOT_URL
Usage :
# Search for <search term> in first name or last name
$0 <search term>
"
function fail {
echo "$1" >&2
exit 1
}
function json_curl { curl --get --fail --silent --show-error -H "Content-Type:application/json" -H "Accept: application/json" "$@"; }
function lspersons {
# List users and output result in csv
json_curl --data-urlencode "search=$1" "$API_ENDPOINT/searchUsers" |\
jq -r '. | (map(keys) | add | unique | sort) as $cols | map(. as $row | $cols | map($row[.])) as $rows | $rows[] | @csv' 2>/dev/null
}
if [ $# -eq 0 ]; then
fail "$USAGE"
fi
# Print the list of persons as a table
lspersons $1 | awk 'BEGIN { FS=OFS="," }; {print $4,$3,$5,$1,$6,$2,$7}' | sed 's/"//g' | column -t -s "," | sort
exit $?
#+end_src
* =contacts= Personnal phone-book
:PROPERTIES:
:CUSTOM_ID: contacts
@@ -33,77 +74,73 @@ khard | fzf --header="Index Name Phone
$TERMINAL --title esrf-phonebook -e contacts
#+end_src
* =qutebrowser=
:PROPERTIES:
:CUSTOM_ID: qutebrowser
:END:
#+begin_src bash :tangle ~/.local/bin/qutebrowser
~/.local/soft/qutebrowser/.venv/bin/python3 -m qutebrowser "$@"
#+end_src
* =remote-home= - Remote Desktop to Home PC
:PROPERTIES:
:CUSTOM_ID: remote-home
:END:
#+begin_src bash :tangle ~/.local/bin/remote-home
notify-send 'Rdesktop' "Connection to Home PC..."
common_arg="/clipboard /bpp:8 /bpp:16 /compression -themes -wallpaper /async-update /async-input -glyph-cache /audio-mode:1 /dynamic-resolution /auto-reconnect /wm-class:RDP_PC /grab-keyboard /cert:ignore"
xfreerdp $common_arg /u:thomas /p:$(pass home_pc/thomas | sed -n 1p) /v:192.168.1.72 > /tmp/freerdp_home_pc.log 2>&1 &
#+end_src
* =remote-desktop= - Remote Desktop Connect
:PROPERTIES:
:CUSTOM_ID: remote-desktop
:END:
#+begin_src bash :tangle ~/.local/bin/remote-desktop
computer=$(echo -e 'WID21SPEEDGOAT1\nWBM23SPEEDGOAT1\nWID24SPEEDGOAT1\nPCMEL1\nRNICE\nPCDEHAEZE\nLAPPAMU1\nPCNASS1\nDesktop-W10' | rofi -i -dmenu -no-custom -p 'Computer:' -l 20);
computer=$(echo -e 'PCOPTRO\nPCMEL1\nRNICE\nPCDEHAEZE\nLAPMEL01\nZOTAC' | rofi -i -dmenu -p 'Computer:' -l 20);
if [[ -z "$computer" ]]; then
exit 1
fi
notify-send 'Rdesktop' "Connection to ${computer}..."
dunstify --replace=99425 'Rdesktop' "Connection to ${computer}..."
proxy_arg=""
if [ "$computer" = "Desktop-W10" ]; then
if [ "$computer" = "ZOTAC" ]; then
# If connect to local PC
if [ ping -c 1 -t 1 desktop-w10.lan &> /dev/null ]; then
ping -c 1 openwrt.lan &> /dev/null
if [ $? -ne 0 ]; then
# And outside of local network, use proxy
proxy_arg="/proxy:socks5://localhost:8080"
fi
elif [ -z "$(timeout 1s dig +short proxy.esrf.fr.)" ]; then
else
ping -c 1 proxy.esrf.fr &> /dev/null
if [ $? -ne 0 ]; then
# Outside the ESRF network
proxy_arg="/proxy:socks5://localhost:8081"
fi
fi
common_arg="/clipboard /bpp:8 /bpp:16 /compression -themes -wallpaper /async-update /async-input -glyph-cache /audio-mode:1 /dynamic-resolution /auto-reconnect /wm-class:RDP_$computer /grab-keyboard /cert:ignore"
common_arg="/clipboard /bpp:32 /compression -themes -wallpaper /audio-mode:1 /dynamic-resolution /auto-reconnect /wm-class:RDP_$computer -grab-keyboard /cert:ignore /rfx /gfx:avc444"
case "$computer" in
"RNICE" | "PCDEHAEZE" | "PCNASS1")
xfreerdp $proxy_arg $common_arg /d:ESRF /u:dehaeze /p:$(pass esrf.fr/dehaeze | sed -n 1p) /v:$computer.esrf.fr > /tmp/freerdp_${computer}.log 2>&1 & ;;
"RNICE" | "PCDEHAEZE")
xfreerdp3 $proxy_arg $common_arg /d:ESRF /u:dehaeze /p:$(pass esrf.fr/dehaeze | sed -n 1p) /v:$computer.esrf.fr > /tmp/freerdp_${computer}.log 2>&1 & ;;
"PCMEL1")
xfreerdp $proxy_arg $common_arg /d:ESRF /u:OPPEL /p:TonicPEL /v:$computer.esrf.fr > /tmp/freerdp_${computer}.log 2>&1 & ;;
"PCMEL1" | "PCOPTRO" | "LAPMEL01")
xfreerdp3 $proxy_arg $common_arg /d:ESRF /u:OPPEL /p:$(pass esrf.fr/oppel | sed -n 1p) /v:$computer.esrf.fr > /tmp/freerdp_${computer}.log 2>&1 & ;;
"WID21SPEEDGOAT1")
xfreerdp $proxy_arg $common_arg /d:ESRF /u:opid21 /p:tonic21 /v:$computer.esrf.fr > /tmp/freerdp_${computer}.log 2>&1 & ;;
"ZOTAC")
xfreerdp3 $proxy_arg $common_arg /u:thomas /p:$(pass windows/zotac | sed -n 1p) /v:192.168.5.75 > /tmp/freerdp_${computer}.log 2>&1 & ;;
"WBM23SPEEDGOAT1")
xfreerdp $proxy_arg $common_arg /d:ESRF /u:opd23 /p:tonic23 /v:$computer.esrf.fr > /tmp/freerdp_${computer}.log 2>&1 & ;;
*)
user=$(rofi -dmenu -p 'User:');
password=$(rofi -dmenu -p 'Password:');
xfreerdp3 $proxy_arg $common_arg /u:$user /p:$password /v:$computer.esrf.fr > /tmp/freerdp_${computer}.log 2>&1 & ;;
"WID24SPEEDGOAT1")
xfreerdp $proxy_arg $common_arg /d:ESRF /u:opid24 /p:tonic24 /v:$computer.esrf.fr > /tmp/freerdp_${computer}.log 2>&1 & ;;
esac
#+end_src
"LAPPAMU1")
xfreerdp $proxy_arg $common_arg /d:ESRF /u:opid00 /p:tonic00 /v:$computer.esrf.fr > /tmp/freerdp_${computer}.log 2>&1 & ;;
* =wake-on-lan= - Wake on LAN
:PROPERTIES:
:CUSTOM_ID: wake-on-lan
:END:
"Desktop-W10")
xfreerdp $proxy_arg $common_arg /d:ESRF /u:thomas /p:$(pass windows/Desktop-W10 | sed -n 1p) /v:192.168.1.72 > /tmp/freerdp_${computer}.log 2>&1 & ;;
#+begin_src bash :tangle ~/.local/bin/wake-on-lan
computer=$(echo -e 'ZOTAC' | rofi -i -dmenu -p 'Computer:' -l 20);
if [[ -z "$computer" ]]; then
exit 1
fi
dunstify --replace=99425 'Wake On Lan' "${computer}..."
case "$computer" in
"ZOTAC")
ssh homelab 'wakeonlan 00:01:2E:A2:42:9C' ;;
esac
#+end_src
@@ -129,9 +166,22 @@ dehaeze@rnice:/home/esrf/dehaeze/ /home/thomas/mnt/unix_home fuse.sshfs no
//wfiles/groupshare /home/thomas/mnt/groupshare vsifs noauto,user,credentials=/home/thomas/.smbcredentials,uid=1001,gid=1001,forceuid,forcegid 0 0
#+end_src
#+begin_src bash :tangle ~/.local/bin/mount-dir
#+begin_src text :tangle no
//wfiles/groupshare /home/thomas/mnt/groupshare cifs noauto,user,uid=1000,gid=1000,credentials=/home/thomas/.smbcredentials 0 0
homelab:/srv/storage/ /home/thomas/mnt/homelab fuse.sshfs noauto,allow_other,user,uid=1000,gid=1000,default_permissions 0 0
dehaeze@rnice:/tmp_14_days/ /home/thomas/mnt/tmp_14_days fuse.sshfs noauto,allow_other,user,uid=1000,gid=1000,default_permissions 0 0
dehaeze@rnice:/home/esrf/dehaeze/ /home/thomas/mnt/unix_home fuse.sshfs noauto,allow_other,user,uid=1000,gid=1000,default_permissions 0 0
dehaeze@rnice:/data/monochromators/ /home/thomas/mnt/monochromators fuse.sshfs noauto,allow_other,user,uid=1000,gid=1000,default_permissions 0 0
dehaeze@rnice:/gpfs/jazzy/data/id21/inhouse /home/thomas/mnt/data_id21 fuse.sshfs noauto,allow_other,user,uid=1000,gid=1000,default_permissions 0 0
blissadm@lmellab:/data/id00/inhouse/DCM /home/thomas/mnt/data_id24 fuse.sshfs noauto,allow_other,user,uid=1000,gid=1000,default_permissions 0 0
blissadm@lmellab:/data/id00/inhouse/MEL /home/thomas/mnt/data_mel fuse.sshfs noauto,allow_other,user,uid=1000,gid=1000,default_permissions 0 0
blissadm@lmellab:/users/blissadm/local /home/thomas/mnt/bliss fuse.sshfs noauto,allow_other,user,uid=1000,gid=1000,default_permissions 0 0
blissadm@lmellab:/data/visitor /home/thomas/mnt/data_bl fuse.sshfs noauto,allow_other,user,uid=1000,gid=1000,default_permissions 0 0
#+end_src
#+begin_src bash :tangle no
if [ $# -eq 0 ]; then
drive=$(echo -e 'monochromators\ntmp_14_days\nhomelab\ngroupshare\nunix_home\ndata_id21' | rofi -dmenu -no-custom -p 'Drive:' -l 20);
drive=$(echo -e 'bliss_mel\nbliss_id21\ndata_bl\ndata_id21\ndata_id24\ndata_mel\ndata_visitor\ndrive\nhomelab\nmonochromators\ntmp_14_days\nunix_home' | rofi -dmenu -no-custom -p 'Drive:' -l 20);
if [[ -z "$drive" ]]; then
exit 1
fi
@@ -142,23 +192,103 @@ fi
if grep -qs "/home/thomas/mnt/$drive" /proc/mounts; then
umount "/home/thomas/mnt/$drive" && \
notify-send "$drive" 'Successfully unmounted' || \
notify-send --urgency=critical "$drive" 'Error while unmounted'
dunstify --replace=58249 "$drive" 'Successfully unmounted' || \
dunstify --replace=58249 --urgency=critical "$drive" 'Error while unmounted'
else
echo "It's not mounted."
mount "/home/thomas/mnt/$drive" && \
notify-send "$drive" 'Successfully mounted' || \
notify-send --urgency=critical "$drive" 'Error while mounted'
dunstify --replace=58249 "$drive" 'Successfully mounted' || \
dunstify --replace=58249 --urgency=critical "$drive" 'Error while mounted'
fi
#+end_src
#+begin_src bash :tangle ~/.local/bin/mount-dir
if [ $# -eq 0 ]; then
# Takes a lot of time with "tmp_14_days" is mounted
# drive=$(find ~/mnt/* -maxdepth 0 -type d -empty -printf '%f\n' | rofi -i -dmenu -no-custom -p 'Drive:' -l 20);
drive=$(ls ~/mnt | rofi -i -dmenu -no-custom -p 'Drive:' -l 20);
if [[ -z "$drive" ]]; then
exit 1
fi
else
exit 1
fi
proxy_arg=""
ping -c 1 proxy.esrf.fr &> /dev/null
if [ $? -ne 0 ]; then
# Outside the ESRF network
proxy_arg=".esrf.fr"
fi
remote_loc=""
case "$drive" in
"homelab")
remote_loc="thomas@homelab:/srv/storage/" ;;
"tmp_14_days")
remote_loc="dehaeze@rnice$proxy_arg:/tmp_14_days/" ;;
"unix_home")
remote_loc="dehaeze@rnice$proxy_arg:/home/esrf/dehaeze/" ;;
"monochromators")
remote_loc="dehaeze@rnice$proxy_arg:/data/monochromators/" ;;
"data_mel")
remote_loc="opid00@lmelcontrol$proxy_arg:/data/id00/inhouse/" ;;
"data_jazzy")
remote_loc="dehaeze@rnice$proxy_arg:/gpfs/jazzy/data/" ;;
"data_easy")
remote_loc="dehaeze@rnice$proxy_arg:/gpfs/easy/data/" ;;
"data_id16a")
remote_loc="blissadm@pico3$proxy_arg:/data/id16a/inhouse1/commissioning/ni_endstation/Speedgoat/" ;;
"data_id31")
remote_loc="opid31@id31$proxy_arg:/data/id31/inhouse/" ;;
"data_id24")
remote_loc="dehaeze@rnice$proxy_arg:/gpfs/gb/data/id24-dcm/inhouse" ;;
"bliss_mel")
remote_loc="blissadm@lmelcontrol$proxy_arg:/users/blissadm/local/" ;;
"bliss_id16a")
remote_loc="blissadm@id16a$proxy_arg:/users/blissadm/local/" ;;
"bliss_id21")
remote_loc="blissadm@id21$proxy_arg:/users/blissadm/local/" ;;
"bliss_bm23")
remote_loc="blissadm@bm23$proxy_arg:/users/blissadm/local/" ;;
"bliss_id24")
remote_loc="blissadm@foucault$proxy_arg:/users/blissadm/local/" ;;
"groupshare")
mount ~/mnt/groupshare && \
exit ;;
esac
if [ -z $remote_loc ]; then
exit
else
sshfs -o allow_other,user,uid=1000,gid=1000,default_permissions,IdentityFile=/home/thomas/.ssh/id_ed25519 $remote_loc /home/thomas/mnt/$drive
fi
# sshfs -o allow_other,user,uid=1000,gid=1000,default_permissions $remote_loc /home/thomas/mnt/$drive
#+end_src
#+begin_src bash :tangle ~/.local/bin/umount-dir
if [ $# -eq 0 ]; then
# Takes a lot of time with tmp_14_days is mounted...
# drive=$(ls ~/mnt/ | rofi -dmenu -no-custom -p 'Drive:' -l 20);
drive=$(find ~/mnt/* -maxdepth 0 -type d -not -empty -printf '%f\n' | rofi -dmenu -no-custom -p 'Drive:' -l 20);
if [[ -z "$drive" ]]; then
exit 1
fi
else
exit 1
fi
umount /home/thomas/mnt/$drive
#+end_src
* =screen-select= - Xrandr pre-defined scripts
:PROPERTIES:
:CUSTOM_ID: screen-select
:END:
#+begin_src bash :tangle ~/.local/bin/screen-select
option=$(echo -e "Work\nLaptop\nHome" | rofi -dmenu -no-custom -p 'Screen:' -l 20)
option=$(echo -e "Work\nLaptop\nHome\nAouste" | rofi -i -dmenu -no-custom -p 'Screen:' -l 20)
if [[ -z "$option" ]]; then
exit 1
@@ -180,15 +310,31 @@ after_screen_change () {
case "$option" in
"Work")
xrandr --output eDP-1 --off --output DP-3-2 --primary --mode 2560x1440 --pos 0x0 --rotate normal && \
xrandr --output eDP-1 --off \
--output DP-3-2 --primary --mode 2560x1440 --pos 0x0 --rotate normal \
--output DP-3-1 --primary --mode 2560x1440 --pos 2560x0 --rotate normal && \
after_screen_change
;;
"Laptop")
xrandr --output DP-1-2 --off --output DP-3-2 --off --output eDP-1 --primary --mode 1920x1200 --pos 0x0 --rotate normal && \
xrandr --output DP-1-1 --off \
--output DP-1-2 --off \
--output DP-3-1 --off \
--output DP-3-2 --off \
--output HDMI-1 --off \
--output eDP-1 --primary --mode 1920x1200 --pos 0x0 --rotate normal && \
after_screen_change
;;
"Home")
xrandr --output eDP-1 --off --output DP-3-2 --primary --mode 2560x1440 --pos 0x0 --rotate normal && \
xrandr --output eDP-1 --off \
--output DP-3-1 --off \
--output DP-3-2 --off \
--output HDMI-1 --off \
--output DP-1-2 --primary --mode 2560x1440 --pos 0x0 --rotate normal && \
after_screen_change
;;
"Aouste")
xrandr --output eDP-1 --off \
--output HDMI-1 --primary --mode 2560x1440 --pos 0x0 --rotate normal && \
after_screen_change
;;
,*)
@@ -204,17 +350,20 @@ exit 0
:CUSTOM_ID: print-esrf
:END:
- To list printers =lpstat -p -d=
#+begin_src bash :tangle ~/.local/bin/print-esrf
nbpage=$(echo -e '1\n2\n4' | rofi -dmenu -no-custom -p 'Number of pages per sheet' -l 20);
sides=$(echo -e 'one-sided\ntwo-sided-long-edge\ntwo-sided-short-edge' | rofi -dmenu -no-custom -p 'Two Sided:' -l 20);
media=$(echo -e 'A4\nA3' | rofi -dmenu -no-custom -p 'Size:' -l 20);
printer=$(echo -e 'ctb127c1u\nctb110c1u' | rofi -dmenu -no-custom -p 'Size:' -l 20);
if [[ -z "$nbpage" || -z "$side" || -z "$media" || -z "$printer" ]]; then
if [[ -z "$nbpage" || -z "$sides" || -z "$media" || -z "$printer" ]]; then
exit 1
fi
lpr -o media=$media -o sides=$sides -o number-up=$nbpage -P $printer "$1";
rsync -zaP "$1" dehaeze@rnice:/home/esrf/dehaeze/Downloads/to-be-printed.pdf && \
ssh rnice "lpr -o media=$media -o sides=$sides -o number-up=$nbpage -P $printer /home/esrf/dehaeze/Downloads/to-be-printed.pdf";
#+end_src
* =readbib= - Open Bibliography File
@@ -239,3 +388,10 @@ List all =pdf= files and open selected one with zathura.
cd ~/Cloud/brain/pdfs/ && ls *.pdf | rofi -dmenu -lines 20 | xargs -I {} zathura {}
#+end_src
* =torrent-add= - Add Torrent using =stig=
Used to add notification when a torrent is added.
#+begin_src bash :tangle ~/.local/bin/torrent-add
stig add $@ && \
dunstify --replace=22221 "Stif" 'Torrent Added' || \
dunstify --replace=22221 --urgency=critical "Stif" 'Failed'
#+end_src

File diff suppressed because it is too large Load Diff

View File

@@ -1,53 +0,0 @@
#+TITLE: BSPWM
#+SETUPFILE: ./setup/org-setup-file.org
#+PROPERTY: header-args:bash :comments both
#+PROPERTY: header-args:bash+ :mkdirp yes
#+PROPERTY: header-args:bash+ :shebang "#!/bin/sh"
#+PROPERTY: header-args:bash+ :tangle ~/.config/bspwm/bspwmrc
* List Desktops
#+begin_src bash
bspc monitor -d code web mail misc figs
#+end_src
* Basic Config
#+begin_src bash
bspc config border_width 1
bspc config window_gap 8
bspc config top_padding 27 # top_padding I set equal to polybar's height
bspc config split_ratio 0.52
bspc config borderless_monocle true
bspc config gapless_monocle true
bspc config focus_follows_pointer true
#+end_src
* Colors
#+begin_src bash
bspc config normal_border_color \#32302f
bspc config focused_border_color \#bdae93
#+end_src
* Rules
Use =xprop= to obtain information about the window.
#+begin_src bash
# If refreshing bspwm, remove all previous rules to prevent doubling up.
bspc rule -r "*"
bspc rule --add qutebrowser desktop='web' follow=on state=tiled
bspc rule --add Emacs desktop='code' follow=on state=tiled
bspc rule --add Zathura state=tiled
bspc rule --add Pavucontrol state=floating
bspc rule --add Blueman-manager state=floating
#+end_src
* Run Polybar and SXHKD
#+begin_src bash
polybar top >>/tmp/polybar.log 2>&1 &
sxhkd -m 1 -c ~/.config/sxhkd/sxhkdrc.bspwm &
#+end_src

View File

@@ -14,18 +14,18 @@ status_path = "~/.config/vdirsyncer/status/"
[pair radicale_calendar]
a = "radicale_calendar_remote"
b = "radicale_calendar_local"
collections = ["76bfc802-3186-e3af-f688-7e165115b4f8", "f78f1649-b54e-7bfe-488d-6a7005a5aa2f"]
collections = ["76bfc802-3186-e3af-f688-7e165115b4f8", "627e2bee-7d6a-49dc-128e-fc7a8aed1e8b"]
conflict_resolution = "a wins"
[storage radicale_calendar_remote]
type = "caldav"
url = "https://radicale.tdehaeze.xyz/tdehaeze/"
username = "tdehaeze"
password.fetch = ["command", "get-pass", "radicale.tdehaeze.xyz/tdehaeze"]
password.fetch = ["command", "~/.local/bin/get-pass", "radicale.tdehaeze.xyz/tdehaeze"]
[storage radicale_calendar_local]
type = "filesystem"
path = "~/.calendars/radicale/"
path = "~/.local/share/calendars/radicale/"
fileext = ".ics"
[pair esrf_calendar]
@@ -38,11 +38,28 @@ conflict_resolution = "a wins"
type = "caldav"
url = "https://calendar.esrf.fr/egroupware/groupdav.php/calendar"
username = "dehaeze"
password.fetch = ["command", "get-pass", "esrf.fr/dehaeze"]
password.fetch = ["command", "~/.local/bin/get-pass", "esrf.fr/dehaeze"]
[storage esrf_calendar_local]
type = "filesystem"
path = "~/.calendars/esrf/"
path = "~/.local/share/calendars/esrf/"
fileext = ".ics"
[pair google_calendar]
a = "google_calendar_remote"
b = "google_calendar_local"
collections = ["af20a7c01c81f7b39b68606db931d7fd9db7d61fe58033f96926107f95a59ae6@group.calendar.google.com"]
conflict_resolution = "a wins"
[storage google_calendar_remote]
type = "google_calendar"
token_file = "~/.local/share/calendars/google/credentials.txt"
client_id = "188415318767-802h28ig8gromo0f72blrbg6cgcop6m8.apps.googleusercontent.com"
client_secret = <<get-password(passname="google_calendar_client_secret")>>
[storage google_calendar_local]
type = "filesystem"
path = "~/.local/share/calendars/google/"
fileext = ".ics"
[pair radicale_contacts]
@@ -53,14 +70,14 @@ conflict_resolution = "a wins"
[storage radicale_contacts_local]
type = "filesystem"
path = "~/.contacts/"
path = "~/.local/share/contacts/"
fileext = ".vcf"
[storage radicale_contacts_remote]
type = "carddav"
url = "https://radicale.tdehaeze.xyz/tdehaeze/"
username = "tdehaeze"
password.fetch = ["command", "get-pass", "radicale.tdehaeze.xyz/tdehaeze"]
password.fetch = ["command", "~/.local/bin/get-pass", "radicale.tdehaeze.xyz/tdehaeze"]
#+END_SRC
* =khal= - CLI calendar application
@@ -73,24 +90,28 @@ password.fetch = ["command", "get-pass", "radicale.tdehaeze.xyz/tdehaeze"]
[calendars]
[[Home]]
path = ~/.calendars/radicale/76bfc802-3186-e3af-f688-7e165115b4f8/
path = ~/.local/share/calendars/radicale/76bfc802-3186-e3af-f688-7e165115b4f8/
color = "#B8BB26" # Green
[[Thesis]]
path = ~/.calendars/radicale/f78f1649-b54e-7bfe-488d-6a7005a5aa2f/
[[Coloc]]
path = ~/.local/share/calendars/google/af20a7c01c81f7b39b68606db931d7fd9db7d61fe58033f96926107f95a59ae6@group.calendar.google.com/
color = "#FB4934" # Red
[[ESRF]]
path = ~/.calendars/esrf/calendar/
path = ~/.local/share/calendars/esrf/calendar/
color = "#83A598" # Blue
[[Birthdays]]
path = ~/.contacts/98ee5e2c-afcf-70e0-c4a2-9fb9de2e97b7/
path = ~/.local/share/contacts/98ee5e2c-afcf-70e0-c4a2-9fb9de2e97b7/
color = "#D3869B" # aqua
type = birthdays
[view]
theme = dark
[highlight_days]
multiple = "#FABD2F" # Yellow
method = fg
multiple = "#FABD2F"
[default]
highlight_event_days = True
@@ -98,6 +119,7 @@ highlight_event_days = True
[locale]
local_timezone= Europe/Berlin
default_timezone= Europe/Berlin
weeknumbers= left
timeformat= %H:%M
dateformat= %d.%m.
longdateformat= %d.%m.%Y
@@ -119,7 +141,7 @@ new = c
#+BEGIN_SRC conf
[addressbooks]
[[contacts]]
path = ~/.contacts/98ee5e2c-afcf-70e0-c4a2-9fb9de2e97b7/
path = ~/.local/share/contacts//98ee5e2c-afcf-70e0-c4a2-9fb9de2e97b7/
[general]
debug = no
@@ -188,7 +210,33 @@ if [[ -f $1 ]]; then
exit;
fi
khal import -a "$calendar" --batch "$1" && \
notify-send --hint=string:x-dunst-stack-tag:fJeNG8gc "Calendar" "Even added";
dunstify "Calendar" "Even added";
fi
fi
#+end_src
* =winmail-add= - Add =winmail.dat= files (Outlook) to Khal
:PROPERTIES:
:CUSTOM_ID: winmail-add
:header-args:bash: :comments both :mkdirp yes
:header-args:bash+: :shebang "#!/usr/bin/env bash"
:header-args:bash+: :tangle-mode (identity #o555)
:header-args:bash+: :tangle ~/.local/bin/winmail-add
:END:
#+begin_src bash
if [[ -f $1 ]]; then
# Convert to ICS
icsfilename=`ytnef -f /tmp $1`
resp=$(echo -e "yes\nno" | rofi -i -only-match -dmenu -p "Would you like to add the event:" -mesg "`khal printics \"$icsfilename\" | tail -n +2`")
if [[ "$resp" == "yes" ]]; then
calendar=$(echo "`khal printcalendars`" | rofi -i -only-match -dmenu -p "Save to:")
if [ -z "$calendar" ]; then
exit;
fi
khal import -a "$calendar" --batch "$icsfilename" && \
dunstify "Calendar" "Even added";
fi
fi
#+end_src

View File

@@ -16,7 +16,7 @@ shadow-exclude = [
"window_type = 'dnd'",
"class_g = 'VirtualBox'",
"class_g ?= 'Notify-osd'",
"name = 'cpt_frame_window'", # For zoom problem when sharing screen
"name = 'cpt_frame_xcb_window'", # For zoom problem when sharing screen
"class_g = 'stalonetray'"
];
#+END_SRC
@@ -42,7 +42,6 @@ mark-wmwin-focused = true;
mark-ovredir-focused = true;
detect-rounded-corners = true;
detect-client-opacity = true;
refresh-rate = 0;
#+END_SRC
* Window Type Setting

View File

@@ -9,12 +9,32 @@ Host *
ControlMaster auto
ControlPath ~/.ssh/master-%r@%h:%p.socket
Host backup
hostname pierrick.tdehaeze.xyz
Port 10022
user thomas
IdentityFile ~/.ssh/id_rsa
Host pierrick
hostname pierrick.tdehaeze.xyz
Port 56432
user pierrick
IdentityFile ~/.ssh/id_rsa
Host homelab
hostname <<get-password(passname="ip/homelab")>>
Port 22
user thomas
IdentityFile ~/.ssh/id_rsa
Host router
hostname 192.168.1.1
Port 22
user root
IdentityFile ~/.ssh/id_rsa
PubkeyAcceptedAlgorithms +ssh-rsa
HostkeyAlgorithms +ssh-rsa
Host *.esrf.fr
User dehaeze
IdentityFile ~/.ssh/id_rsa
@@ -26,7 +46,6 @@ Host firewall.esrf.fr
Match host *.esrf.fr !host firewall.esrf.fr !exec "~/.ssh/esrf-test"
ProxyJump firewall.esrf.fr
Host rnice
Port 22
user dehaeze
@@ -34,7 +53,7 @@ Host rnice
#+end_src
#+begin_src bash :tangle ~/.ssh/esrf-test :comments none :mkdirp yes :shebang "#!/usr/bin/env bash" :tangle-mode (identity #o555)
test -n "$(timeout 1s dig +short proxy.esrf.fr.)"
test -n "$(ping -c1 -W1 -q proxy.esrf.fr. &> /dev/null )"
#+end_src
* Font
@@ -70,7 +89,7 @@ test -n "$(timeout 1s dig +short proxy.esrf.fr.)"
* GnuPG
:PROPERTIES:
:header-args: :tangle ~/.gnupg/gpg-agent.conf
:header-args: :tangle ~/.config/gnupg/gpg-agent.conf
:header-args+: :comments both :mkdirp yes
:END:
@@ -104,35 +123,6 @@ lat=45.1
lon=5.7
#+end_src
* dmenu
:PROPERTIES:
:header-args: :tangle ~/.dmenurc
:header-args+: :comments both :mkdirp yes
:END:
#+BEGIN_SRC conf
# define the font for dmenu to be used
DMENU_FN="Hack Nerd Font 12"
# background colour for unselected menu-items
DMENU_NB="#222D31"
# textcolour for unselected menu-items
DMENU_NF="#F9FAF9"
# background colour for selected menu-items
DMENU_SB="#16A085"
# textcolour for selected menu-items
DMENU_SF="#F9FAF9"
# command for the terminal application to be used:
TERMINAL_CMD="terminal -e"
# export our variables
DMENU_OPTIONS="-fn $DMENU_FN -nb $DMENU_NB -nf $DMENU_NF -sf $DMENU_SF -sb $DMENU_SB"
#+END_SRC
* Locale
:PROPERTIES:
:header-args: :tangle ~/.config/locale.conf
@@ -727,4 +717,44 @@ It is very important that =~/.netrc= as =600= permissions.
machine torrent.tdehaeze.xyz
login tdehaeze
password <<get-password(passname="nas/transmission")>>
machine prowlarr.tdehaeze.xyz
login tdehaeze
password <<get-password(passname="prowlarr.tdehaeze.xyz/tdehaeze")>>
#+end_src
* Gotify Dunst
#+begin_src conf :comments none :mkdirp yes :noweb yes :tangle ~/.config/gotify-dunst/gotify-dunst.conf
[server]
ssl=true
domain=gotify.tdehaeze.xyz
token=<<get-password(passname="nas/gotify_laptop")>>
#+end_src
* SMBCredentials
#+begin_src conf :comments none :mkdirp yes :noweb yes :tangle ~/.smbcredentials :tangle-mode (identity #o600)
user=dehaeze
password=<<get-password(passname="esrf.fr/dehaeze")>>
domain=esrf
#+end_src
* Keyboard repetition rate
Install [[https://github.com/SFTtech/xautocfg][xautocfg]] with =paru -S xautocfg=.
Then create =~/.config/xautocfg.cfg= with:
#+begin_src conf :tangle ~/.config/xautocfg.cfg
# xautocfg config
[keyboard]
# set keyboard repeat rate for every keyboard automatically
# equivalent one-time invocation:
# xset r rate 220 45
# when to start repeating
delay = 200
# rate in hz for repetitions
rate = 40
#+end_src
And then enable the service with: =systemctl --user enable xautocfg.service=

View File

@@ -5092,68 +5092,3 @@
🏴‍☠️ pirate flag; U+1F3F4 U+200D U+2620 U+FE0F
#+end_src
* Nordvpn Countries
:PROPERTIES:
:CUSTOM_ID: nordvpn-countries
:END:
#+begin_src conf :tangle ~/.local/data/nordvpn_countries.txt
Albania
Bulgaria
Denmark
Hong_Kong
Italy
Netherlands
Serbia
Sweden
United_States
Argentina
Canada
Estonia
Hungary
Japan
New_Zealand
Singapore
Switzerland
Vietnam
Australia
Chile
Finland
Iceland
Latvia
North_Macedonia
Slovakia
Taiwan
Austria
Costa_Rica
France
India
Luxembourg
Norway
Slovenia
Thailand
Belgium
Croatia
Georgia
Indonesia
Malaysia
Poland
South_Africa
Turkey
Bosnia_And_Herzegovina
Cyprus
Germany
Ireland
Mexico
Portugal
South_Korea
Ukraine
Brazil
Czech_Republic
Greece
Israel
Moldova
Romania
Spain
United_Kingdom
#+end_src

1854
doom.org

File diff suppressed because it is too large Load Diff

View File

@@ -30,6 +30,16 @@ echo "[[file:$_figdir/$filename.$ext]]"
(cons (car tbl) (cons 'hline (cdr tbl)))
#+end_src
* Python Related
** =python-dir= Go to current directory
#+name: python-dir
#+begin_src python :tangle no :results none :exports none :var current_dir=""
# Go to current Directory
import os
os.chdir(current_dir)
#+end_src
* Matlab Related
** =matlab-dir= Go to current directory

View File

@@ -424,19 +424,23 @@ $0
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
#name :Python-Figure
# --
,#+begin_src jupyter-python :file ${2:filename}.png :results none
# Figure - ${1:description}
plt.figure(figsize=(${3:1200}/150, ${4:800}/150), dpi=150)
plt.clf
,#+begin_src python :exports none :results none
# ${1:description}
fig = plt.figure()
$0
plt.savefig('figs/$2.pdf', transparent=True, bbox_inches='tight', pad_inches=0)
,#+end_src
,#+begin_src python :tangle no :results output file replace :file
plt.savefig('figs/${2:filename}.pdf', bbox_inches='tight', pad_inches=0)
,#+end_src
,#+name: fig:$2
,#+caption: $1
,#+RESULTS:
[[file:figs/$2.png]]
#+end_src
** Matlab Specific
*** Mconfig
#+begin_src conf :tangle ~/.config/doom/snippets/org-mode/mconfig

28
git.org
View File

@@ -1,9 +1,9 @@
#+TITLE: Git Configuration
#+SETUPFILE: ./setup/org-setup-file.org
* =~/.gitconfig=
* =gitconfig=
:PROPERTIES:
:header-args:conf: :tangle ~/.gitconfig
:header-args:conf: :tangle ~/.config/git/config
:header-args:conf+: :comments both :mkdirp yes
:END:
@@ -157,12 +157,10 @@
# http://michael-kuehnel.de/git/2014/11/21/git-mac-osx-and-german-umlaute.html
precomposeunicode = false
pager = diff-so-fancy | less --tabs=4 -RFX
autocrlf = input
# Open vim, start Goyo and enter insert mode on the first line
editor = "nvim -c ':Goyo' -c 'goto 1' -c 'startinsert'"
# editor = "nvim -c ':Goyo' -c 'goto 1' -c 'startinsert'"
#+END_SRC
** Credentials using pass
@@ -180,24 +178,12 @@
username = dehaeze
#+END_SRC
** Diff-so-fancy
** Status
#+begin_src conf
[diff-so-fancy]
markEmptyLines = false
[status]
showUntrackedFiles = all
#+end_src
* =~/.gitignore_global= - Global Git Ignore
:PROPERTIES:
:header-args:conf: :tangle ~/.gitignore_global
:header-args:conf+: :comments both :mkdirp yes
:END:
#+BEGIN_SRC conf
*~
.DS_Store
Session.vim
#+END_SRC
* =pass-git-helper= - Use =pass= for git passwords
:PROPERTIES:
:header-args: :tangle ~/.config/pass-git-helper/git-pass-mapping.ini
@@ -206,7 +192,7 @@ Session.vim
#+BEGIN_SRC conf
[github.com*]
target=github.com/tdehaeze
target=github.com/dehaeze.thomas@gmail.com
[git.tdehaeze.xyz*]
target=git.tdehaeze.xyz/tdehaeze

View File

@@ -3,7 +3,7 @@
* GTK-2.0
:PROPERTIES:
:header-args: :tangle ~/.gtkrc-2.0.mine
:header-args: :tangle ~/.config/gtkrc-2.0
:header-args+: :comments both :mkdirp yes
:END:

File diff suppressed because it is too large Load Diff

168
i3.org
View File

@@ -12,18 +12,19 @@
Set mod key (Mod1=<Alt>, Mod4=<Super>)
#+BEGIN_SRC conf
set $mod Mod4
set $alt Mod1
#+end_src
* Border Style
#+begin_src conf
# Use custom colors for black
new_window pixel 1
new_float normal
default_border pixel 2
default_floating_border pixel 2
for_window [class="^.*"] border pixel 2
#+end_src
Hide borders
#+begin_src conf
hide_edge_borders smart
hide_edge_borders none
#+end_src
* Font for window titles
@@ -68,20 +69,16 @@ Layout mode for new containers
workspace_layout default
#+end_src
* Focus Configuration
#+begin_src conf
focus_follows_mouse no
#+end_src
* Border
#+begin_src conf
default_border pixel 2
#+end_src
* Settings for i3-gaps
#+begin_src conf
gaps inner 10
gaps outer 1
smart_gaps on
smart_gaps off
#+end_src
* Workspace names
@@ -98,6 +95,19 @@ set $ws7 7
set $ws8 8
#+end_src
#+begin_src conf
workspace 1 output DP-3-2
workspace 3 output DP-3-2
workspace 5 output DP-3-2
workspace 7 output DP-3-2
workspace 9 output DP-3-2
workspace 2 output DP-3-1
workspace 4 output DP-3-1
workspace 6 output DP-3-1
workspace 8 output DP-3-1
#+end_src
* Use Mouse+$mod to drag floating windows
#+begin_src conf
floating_modifier $mod
@@ -111,34 +121,53 @@ workspace_auto_back_and_forth yes
* Application Specific
** Open applications on specific workspaces
#+begin_src conf
assign[title="^Fig"] $ws6 # Matlab Figures
for_window [title="^Fig"] move to workspace $ws6
for_window [title="^HG_Peer"] move to workspace $ws6
for_window [title="^Fig"] layout tabbed
assign[title="^HG_Peer"] $ws6 # Name of window when export figure with matlab
assign[class="^RDP"] $ws7 # Remote
#+end_src
#+begin_src conf
# assign[class="^RDP"] 7 # Remote
for_window [class="^RDP"] move to workspace $ws7
for_window [class="^RDP"] layout tabbed
#+end_src
** Open specific applications in floating mode
#+begin_src conf
for_window [class="floating"] floating enable
for_window [title="File Transfer*"] floating enable
for_window [class="GParted"] floating enable border normal
for_window [class="Lxappearance"] floating enable sticky enable border normal
for_window [class="Pavucontrol"] floating enable
for_window [class="pwvucontrol"] floating enable
for_window [class="Arandr"] floating enable
for_window [class="Simple-scan"] floating enable border normal
for_window [class="(?i)System-config-printer.py"] floating enable border normal
for_window [title="^Documentation -"] floating enable border normal
for_window [class="Yad"] floating enable
for_window [title="Bluetooth Devices"] floating enable
for_window [title="Simulink Library Browser"] floating enable
for_window [class="Floating"] floating enable, resize set 800 600, move position 1100 460
for_window [class="mpv"] floating enable # Size/Position is defined in mpv.conf
for_window [class="Sxiv"] floating enable, resize set 800 600, move position center
for_window [class="Nsxiv"] floating enable, resize set 800 600, move position center
for_window [class="Cropgui"] floating enable, resize set 800 600, move position center
for_window [title="khal"] floating enable, resize set 600 600, move position center
for_window [class="jellyfin-tui"] floating enable, resize set 1200 800, move position center
for_window [title="ncmpcpp"] floating enable, resize set 800 400, move position center
for_window [title="stig"] floating enable, resize set 800 400, move position center
for_window [title="Sensors"] floating enable, resize set 800 400, move position center
for_window [title="TexText"] floating enable, resize set 800 400, move position center
for_window [title="nmtui"] floating enable, resize set 800 600, move position center
for_window [title="Xournal"] floating enable, resize set 1100 750, move position center
for_window [title="esrf-phonebook"] floating enable, resize set 1400 400, move position center
for_window [title="^zoom$" class="[zoom]*"] floating enable
for_window [title="F3D"] floating enable, resize set 800 600, move position center
# Simulink
for_window [title="Simulink Library Browser"] floating enable
for_window [title="^Block Parameters:.*"] floating enable, move position center
#+end_src
** Others
#+begin_src conf
no_focus [title="zoom_linux_float_message_reminder"]
#+end_src
* Scratchpad
@@ -153,8 +182,113 @@ If there are multiple scratchpad windows, this command cycles through them.
bindsym $mod+BackSpace scratchpad show
#+end_src
* I3 key bindings
** Kill Window
#+begin_src conf
# close and kill
bindsym $mod+q kill
#+end_src
** Set the window State
#+begin_src conf
# Set the window to full-screen
bindsym $mod+f fullscreen toggle
# Set the window to floating
bindsym $mod+s floating toggle
# Alternate between the tiled and normal layout
bindsym $mod+t layout toggle tabbed split
# Change focus between tiling / floating windows
bindsym $mod+c focus mode_toggle
# Sticky window
bindsym $mod+y sticky toggle
#+end_src
** focus/swap
#+begin_src conf
# Focus/swap the node in the given direction
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right
bindsym $mod+Shift+h move left
bindsym $mod+Shift+j move down
bindsym $mod+Shift+k move up
bindsym $mod+Shift+l move right
#+end_src
#+begin_src conf
# Focus the next/previous desktop in the current monitor
bindsym $mod+p workspace prev
bindsym $mod+n workspace next
# Focus the last Desktop
bindsym $mod+b workspace back_and_forth
# Focus to the given desktop
bindsym $mod+1 workspace 1
bindsym $mod+2 workspace 2
bindsym $mod+3 workspace 3
bindsym $mod+4 workspace 4
bindsym $mod+5 workspace 5
bindsym $mod+6 workspace 6
bindsym $mod+7 workspace 7
bindsym $mod+8 workspace 8
bindsym $mod+9 workspace 9
bindsym $mod+ctrl+1 move container to workspace 1
bindsym $mod+ctrl+2 move container to workspace 2
bindsym $mod+ctrl+3 move container to workspace 3
bindsym $mod+ctrl+4 move container to workspace 4
bindsym $mod+ctrl+5 move container to workspace 5
bindsym $mod+ctrl+6 move container to workspace 6
bindsym $mod+ctrl+7 move container to workspace 7
bindsym $mod+ctrl+8 move container to workspace 8
bindsym $mod+ctrl+9 move container to workspace 9
bindsym $mod+Shift+1 move container to workspace 1; workspace 1
bindsym $mod+Shift+2 move container to workspace 2; workspace 2
bindsym $mod+Shift+3 move container to workspace 3; workspace 3
bindsym $mod+Shift+4 move container to workspace 4; workspace 4
bindsym $mod+Shift+5 move container to workspace 5; workspace 5
bindsym $mod+Shift+6 move container to workspace 6; workspace 6
bindsym $mod+Shift+7 move container to workspace 7; workspace 7
bindsym $mod+Shift+8 move container to workspace 8; workspace 8
bindsym $mod+Shift+9 move container to workspace 9; workspace 9
#+end_src
** Preselect
Preselect the direction
#+begin_src conf
# Set Horizontal Layout
bindsym $mod+ctrl+h split h
bindsym $mod+ctrl+l split h
# Set Vertical Layout
bindsym $mod+ctrl+j split v
bindsym $mod+ctrl+k split v
#+end_src
** Resize
Expand/Shrink a window
#+begin_src conf
# Horizontal Shrink
bindsym $mod+$alt+h resize shrink width 10 px or 10 ppt
# Vertical Grow
bindsym $mod+$alt+j resize grow height 10 px or 10 ppt
# Vertical Shrink
bindsym $mod+$alt+k resize shrink height 10 px or 10 ppt
# Horizontal Grow
bindsym $mod+$alt+l resize grow width 10 px or 10 ppt
#+end_src
* Run Polybar and SXHKD
#+begin_src conf
exec --no-startup-id sxhkd -m 1 -c ~/.config/sxhkd/sxhkdrc.i3
# exec --no-startup-id sxhkd -m 1 -c ~/.config/sxhkd/sxhkdrc.i3
exec --no-startup-id sxhkd -m 1
exec --no-startup-id polybar top >>/tmp/polybar.log 2>&1 &
#+end_src

View File

@@ -1,7 +1,7 @@
#+TITLE: SXIV Configuration
#+TITLE: NSXIV Configuration
#+SETUPFILE: ./setup/org-setup-file.org
#+PROPERTY: header-args:conf :tangle ~/.config/sxiv/exec/key-handler
#+PROPERTY: header-args:conf :tangle ~/.config/nsxiv/exec/key-handler
#+PROPERTY: header-args:conf+ :comments both :mkdirp yes
#+PROPERTY: header-args:conf+ :shebang "#!/usr/bin/env bash"

View File

@@ -7,7 +7,7 @@
The general installation procedure is described [[file:install.org][here]].
There are Specific configuration files for:
- *Windows Manager*: [[file:bspwm.org][BSPWM]] and [[file:i3.org][I3]]
- *Windows Manager*: [[file:i3.org][I3]]
- *Hotkey Manager*: [[file:sxhkd.org][SXHKD]]
- *Status Bar*: [[file:polybar.org][Polybar]]
- *Launcher*: [[file:rofi.org][Rofi]]
@@ -19,16 +19,14 @@ There are Specific configuration files for:
- *Shell*: [[file:bash.org][Bash]]
- *Terminal Emulator*: [[file:alacritty.org][Alacritty]]
- *Terminal Multiplexer* [[file:tmux.org][Tmux]]
- *Image Setup*: [[file:image.org][Sxiv]]
- *Music Setup*: [[file:music.org][Ncmpcpp, Mopidy and Beets]]
- *Image Setup*: [[file:image.org][Nsxiv]]
- *Music Setup*: [[file:music.org][Ncmpcpp and Mopidy]]
- *Video Setup*: [[file:video.org][Mpv]]
- *Web Browser*: [[file:qutebrowser.org][Qutebrowser]]
- *PDF Reader*: [[file:zathura.org][Zathura]]
- *GUI File Manager*: [[file:pcmanfm.org][PCManFM]]
- *Terminal File Manager*: [[file:ranger.org][Ranger]]
- *Terminal File Manager*: [[file:yazi.org][Yazi]]
- *Calendar and Contacts*: [[file:calendar-contact.org][Vdirsyncer, Khal and Khard]]
- *Mails*: [[file:mail.org][Mbsync, Msmtp, Mu and Neomutt]]
- *RSS-Reader*: [[file:newsboat.org][Newsboat]]
- *Version Control*: [[file:git.org][Git]]
- *Scripts*: [[file:binaries.org][Scripts]]
- *Desktop Applications*: [[file:applications.org][.desktop files]]
@@ -38,6 +36,6 @@ There are Specific configuration files for:
I also have:
- a nice Home-Server ([[file:homelab.org][conf]])
- a Linux smart-TV ([[file:smart-tv.org][conf]])
- a Windows PC that I occasionally use ([[file:windows.org][conf]])
- an Android phone ([[file:android.org][conf]])
- a backup server

View File

@@ -4,6 +4,29 @@
#+PROPERTY: header-args :comments no
#+PROPERTY: header-args+ :mkdirp yes
#+begin_src conf :tangle /home/thomas/.config/inkscape/palettes/reasonable_colors.gpl
GIMP Palette
Name: Matlab Colors
#
# Last update: 26.04.2022
#
# Original palette by Matthew Howell
# reasonable.work/colors
#
# GPL palette coded by Rob Mocci (with permission)
# patreon.com/rmocci
#
0 114 189
217 83 25
237 177 32
126 47 142
119 172 48
77 190 238
162 20 47
0 0 0
255 255 255
#+end_src
* Save Selection to SVG extension
** =ink= file

File diff suppressed because it is too large Load Diff

78
kitty.org Normal file
View File

@@ -0,0 +1,78 @@
#+title: Kitty
#+SETUPFILE: ./setup/org-setup-file.org
#+PROPERTY: header-args :tangle ~/.config/kitty/kitty.conf
#+PROPERTY: header-args+ :comments both :mkdirp yes
* Colors
#+begin_src conf
# Based on https://github.com/morhetz/gruvbox by morhetz <morhetz@gmail.com>
# Adapted to kitty by wdomitrz <witekdomitrz@gmail.com>
cursor #928374
cursor_text_color background
url_color #83a598
visual_bell_color #8ec07c
bell_border_color #8ec07c
active_border_color #d3869b
inactive_border_color #665c54
foreground #ebdbb2
background #32302f
selection_foreground #928374
selection_background #ebdbb2
active_tab_foreground #fbf1c7
active_tab_background #665c54
inactive_tab_foreground #a89984
inactive_tab_background #3c3836
# black (bg3/bg4)
color0 #665c54
color8 #7c6f64
# red
color1 #cc241d
color9 #fb4934
#: green
color2 #98971a
color10 #b8bb26
# yellow
color3 #d79921
color11 #fabd2f
# blue
color4 #458588
color12 #83a598
# purple
color5 #b16286
color13 #d3869b
# aqua
color6 #689d6a
color14 #8ec07c
# white (fg4/fg3)
color7 #a89984
color15 #bdae93
#+end_src
* Fonts
#+begin_src conf
font_family family="SauceCodePro Nerd Font Mono"
bold_font auto
italic_font auto
bold_italic_font auto
font_size 10.0
#+end_src
* Other configs
#+begin_src conf
confirm_os_window_close 0
#+end_src

674
mail.org
View File

@@ -3,12 +3,12 @@
Installation:
#+begin_src bash :tangle no
sudo apt install mbsync msmtp maildir-utils neomutt lynx
paru -S mbsync msmtp neomutt lynx urlview
#+end_src
* =mbsync= - Synchronize Mailboxes
:PROPERTIES:
:header-args:conf: :tangle ~/.mbsyncrc
:header-args:conf: :tangle ~/.config/isync/mbsyncrc
:header-args:conf+: :comments both :mkdirp yes
:CUSTOM_ID: mbsync
:END:
@@ -30,7 +30,7 @@ IMAPAccount gmail
Host imap.gmail.com
User dehaeze.thomas@gmail.com
PassCmd "pass email/dehaeze.thomas@gmail.com"
SSLType IMAPS
TLSType IMAPS
AuthMechs LOGIN
CertificateFile /etc/ssl/certs/ca-certificates.crt
#+END_SRC
@@ -40,8 +40,8 @@ IMAPStore gmail-remote
Account gmail
MaildirStore gmail-local
Path ~/.mail/gmail/
Inbox ~/.mail/gmail/Inbox
Path ~/.local/share/mails/gmail/
Inbox ~/.local/share/mails/gmail/Inbox
Channel gmail-Home
Far :gmail-remote:INBOX
@@ -97,7 +97,7 @@ IMAPAccount esrf
Host imaps.esrf.fr
User dehaeze
PassCmd "pass email/thomas.dehaeze@esrf.fr"
SSLType IMAPS
TLSType IMAPS
AuthMechs LOGIN
#+END_SRC
@@ -106,8 +106,8 @@ IMAPStore esrf-remote
Account esrf
MaildirStore esrf-local
Path ~/.mail/esrf/
Inbox ~/.mail/esrf/Inbox
Path ~/.local/share/mails/esrf/
Inbox ~/.local/share/mails/esrf/Inbox
Channel esrf-Home
Far :esrf-remote:INBOX
@@ -171,8 +171,8 @@ protocol smtp
from dehaeze.thomas@gmail.com
user dehaeze.thomas@gmail.com
passwordeval "pass email/dehaeze.thomas@gmail.com"
proxy_host localhost
proxy_port 8080
# proxy_host localhost
# proxy_port 8080
#+END_SRC
** ESRF Account
@@ -546,7 +546,7 @@ bind index,pager @ compose-to-sender
# Marl All message as read
macro index \Cr \
"<tag-pattern>~N<enter><tag-prefix><clear-flag>N<untag-pattern>.<enter>" \
"<tag-pattern>~O<enter><tag-prefix><clear-flag>O<untag-pattern>.<enter><tag-pattern>~N<enter><tag-prefix><clear-flag>N<untag-pattern>.<enter>" \
"mark all new as read"
#+end_src
@@ -589,7 +589,6 @@ Write/Reply/Forward mail
#+BEGIN_SRC conf
bind index,pager p recall-message
bind index,pager m mail
bind index,pager M resend-message
bind index,pager r reply
bind index,pager R group-reply
bind index,pager b bounce-message
@@ -603,6 +602,7 @@ bind index,pager s sync-mailbox
Sync email
#+BEGIN_SRC conf
macro index,pager e "<shell-escape>$HOME/.config/neomutt/bin/get_new_esrf_mail.sh<enter>"
macro index,pager o "<shell-escape>$HOME/.config/neomutt/bin/get_new_mail.sh<enter>"
macro index,pager O "<shell-escape>$HOME/.config/neomutt/bin/get_new_mail.sh -a<enter>"
#+END_SRC
@@ -646,7 +646,7 @@ bind attach q exit
bind attach <return> view-mailcap
macro attach W <save-entry><kill-line>~/Downloads/<enter>y "Save entry"
macro attach W <save-entry><kill-line>$HOME/Downloads/<enter>y "Save entry"
#+end_src
*** Compose
@@ -658,42 +658,48 @@ bind compose R rename-attachment
bind compose a attach-file
#+END_SRC
Open another instance of neomutt in readonly mode while composing
Open another instance of Neomutt in read-only mode while composing
#+BEGIN_SRC conf
macro compose M "<shell-escape>$TERMINAL -e \"neomutt -R\"<enter>"
# macro compose M "<shell-escape>$TERMINAL -e \"neomutt -R\"<enter>"
#+END_SRC
Attach multiple files using ranger
Attach multiple files using yazi
#+begin_src conf
macro compose A "<shell-escape>bash $HOME/.config/neomutt/bin/rangerpick<enter><enter-command>source /tmp/rangerpick<enter><shell-escape>bash $HOME/.config/neomutt/bin/rangerpick clean<enter>" "Attach with Ranger"
macro compose A "<shell-escape>bash $HOME/.config/neomutt/bin/yazipick<enter><enter-command>source /tmp/yazipick<enter><shell-escape>bash $HOME/.config/neomutt/bin/yazipick clean<enter>" "Attach with Yazi"
#+end_src
Attach file by drooping from GUI
#+begin_src conf
macro compose B "<shell-escape>bash $HOME/.config/neomutt/bin/rangerpick dragon<enter><enter-command>source /tmp/rangerpick<enter><shell-escape>bash $HOME/.config/neomutt/bin/rangerpick clean<enter>" "Attach with Ranger"
#+end_src
**** Attach with Ranger Script
**** Attach with yazi
:PROPERTIES:
:header-args: :tangle ~/.config/neomutt/bin/rangerpick
:header-args: :tangle ~/.config/neomutt/bin/yazipick
:header-args+: :comments both :mkdirp yes
:header-args+: :shebang "#!/usr/bin/env bash"
:END:
#+begin_src bash
tmpfile=/tmp/rangerpick
# Define temporary file path
tmpfile="/tmp/yazipick"
# Check if a parameter is passed to the script
if [ -z "$1" ]; then
ranger --choosefiles $tmpfile && sed -i 's/\s/\\ /g' $tmpfile && echo "$(awk 'BEGIN {printf "%s", "push "} {printf "%s", "<attach-file>"$0"<enter>"}' $tmpfile)" > $tmpfile
elif [ $1 == "dragon" ]; then
dragon --target --print-path --keep > $tmpfile && sed -i 's/\s/\\ /g' $tmpfile && echo "$(awk 'BEGIN {printf "%s", "push "} {printf "%s", "<attach-file>"$0"<enter>"}' $tmpfile)" > $tmpfile
elif [ $1 == "clean" ]; then
ls $tmpfile
# Select files using yazi and save them to tmpfile
yazi --chooser-file "$tmpfile"
# Only proceed if files were actually selected
if [ -s "$tmpfile" ]; then
awk 'BEGIN {printf "push "} {printf "<attach-file>\"%s\"<enter>", $0} END {print ""}' "$tmpfile" > "$tmpfile.tmp" &&
mv "$tmpfile.tmp" "$tmpfile"
fi
elif [ "$1" == "clean" ]; then
# Clean up the temporary file if "clean" is passed as argument
rm -f "$tmpfile"
fi
#+end_src
**** Send HTML mails using Markdown
Write html emails using markdown
**** Send HTML mails using Org mode
#+BEGIN_SRC conf
# macro compose M "F pandoc -s -f markdown -t html \ny^T^Utext/html; charset=us-ascii\n"
macro compose Y "<first-entry>\
<pipe-entry>$HOME/.config/neomutt/bin/convert-multipart.sh<enter>\
<enter-command>source /tmp/neomutt-commands<enter>"
#+END_SRC
*** Browser
@@ -721,7 +727,7 @@ bind index,pager \Ch sidebar-toggle-visible
*** Reload Configuration
#+begin_src conf
macro generic,index,pager,editor ,<Space> ":source ~/.config/neomutt/neomuttrc\n" "Reload mutt's configuration file"
macro generic,index,pager,editor ,<Space> ":source $HOME/.config/neomutt/neomuttrc\n" "Reload mutt's configuration file"
#+end_src
*** urlview - Open URL in emails
@@ -738,18 +744,15 @@ macro attach,compose,index,pager \cw "\
*** Searching using Mu
#+begin_src conf
macro index,pager \Cf "<shell-escape>$HOME/.config/neomutt/bin/search_mail.sh<enter><change-folder-readonly>~/.mail/search<enter>" \
macro index,pager \Cf "<shell-escape>$HOME/.config/neomutt/bin/search_mail.sh<enter><change-folder-readonly>$HOME/.local/share/mails/search<enter>" \
"test"
# macro index,pager \Cf "<shell-escape>mu find --clearlinks --format=links --linksdir=~/.mail/search " \
# macro index,pager \Cf "<shell-escape>mu find --clearlinks --format=links --linksdir=$HOME/.local/share/mails/search " \
# "mu find"
macro index,pager gf "<change-folder-readonly>~/.mail/search<enter>" \
macro index,pager gf "<change-folder-readonly>$HOME/.local/share/mails/search<enter>" \
"mu find results"
#+end_src
*** Link to Orgmode
https://www.donarmstrong.com/posts/org_mode_mutt_capture/
https://upsilon.cc/~zack/blog/posts/2010/02/integrating_Mutt_with_Org-mode/
#+begin_src conf
macro index,pager S "<pipe-message>$HOME/.config/neomutt/bin/mutt-save-org-link.py\n"
#+end_src
@@ -761,29 +764,92 @@ macro index,pager S "<pipe-message>$HOME/.config/neomutt/bin/mutt-save-org-link.
:header-args+: :shebang "#!/usr/bin/env python3"
:END:
https://orgmode.org/manual/The-capture-protocol.html#The-capture-protocol
#+begin_src python
#!/usr/bin/env python3
import sys
import email
from email import policy
import subprocess
import urllib.parse
import platform
import subprocess # Keep for potential fallback or notification
import pyperclip # Use pyperclip for clipboard
def notify_user(title, message):
"""Attempt to send a desktop notification (optional)."""
system = platform.system()
try:
if system == 'Linux':
subprocess.Popen(['notify-send', '--urgency=low', '--icon=mail-message-new', title, message])
elif system == 'Darwin': # macOS
# Requires 'terminal-notifier' (brew install terminal-notifier)
# Or use osascript
subprocess.Popen([
'osascript', '-e',
f'display notification "{message}" with title "{title}"'
])
# Add Windows notification if needed
except FileNotFoundError:
# notify-send or osascript not found, ignore
pass
except Exception as e:
print(f"Notification failed: {e}", file=sys.stderr)
# --- Main Script ---
# Parse the email from standard input
message_bytes = sys.stdin.buffer.read()
message = email.message_from_bytes(message_bytes, policy=policy.default)
try:
message_bytes = sys.stdin.buffer.read()
# Use policy.default for robust parsing of modern emails
message = email.message_from_bytes(message_bytes, policy=policy.default)
except Exception as e:
print(f"Error parsing email: {e}", file=sys.stderr)
notify_user("Mutt Org Link Error", f"Failed to parse email: {e}")
sys.exit(1)
# Grab the relevant message headers
message_id = urllib.parse.quote(message['message-id'][1:-1])
subject = message['subject']
message_to = message['to']
# Grab the relevant message headers, handling potential missing headers
raw_message_id = message.get('message-id')
subject = message.get('subject', '(No Subject)') # Use default if subject is missing
# Ask emacsclient to save a link to the message
subprocess.Popen([
'emacsclient',
f'org-protocol://capture?template=ps&url={message_id}&title={subject}&body={message_to}'
])
# Clean the Message-ID (remove <>)
if raw_message_id:
message_id = raw_message_id.strip('<>')
else:
message_id = None
# Check if we got the essential Message-ID
if not message_id:
error_msg = "Could not find Message-ID header in the email."
print(error_msg, file=sys.stderr)
notify_user("Mutt Org Link Error", error_msg)
sys.exit(1)
# Construct the Org mode link
# Format: [[message:message_id][subject]]
# No URL encoding needed for the message_id here
org_link = f"[[message:{message_id}][{subject}]]"
# Copy the link to the clipboard using pyperclip
try:
pyperclip.copy(org_link)
success_msg = f"Org link copied:\n{org_link}"
print(success_msg, file=sys.stderr) # Print to stderr for logs/debug
notify_user("Mutt Org Link Copied", f"Subject: {subject}") # Send desktop notification
# Optional: Add a terminal bell sound
# print('\a', file=sys.stderr)
sys.exit(0) # Success
except Exception as e:
# Provide specific error feedback if pyperclip fails (e.g., missing backend)
error_msg = f"Error copying to clipboard: {e}"
print(error_msg, file=sys.stderr)
if "clipboard command not found" in str(e).lower() or \
isinstance(e, pyperclip.PyperclipException):
print("\nPlease ensure a clipboard utility is installed:", file=sys.stderr)
print("- Linux: install 'xclip' or 'xsel'", file=sys.stderr)
print("- macOS: should work out-of-the-box (pbcopy)", file=sys.stderr)
print("- Windows: should work out-of-the-box (clip)", file=sys.stderr)
notify_user("Mutt Org Link Error", "Failed to copy link to clipboard.")
sys.exit(1) # Failure
#+end_src
** Colors
@@ -853,13 +919,13 @@ bind editor <Tab> complete-query
** Paths
#+BEGIN_SRC conf
set folder = ~/.mail # mail location
set alias_file = ~/.config/neomutt/alias # where to store aliases
set header_cache = ~/.config/neomutt/cache/headers # where to store headers
set message_cachedir = ~/.config/neomutt/cache/bodies # where to store bodies
set certificate_file = ~/.config/neomutt/certificates # where to store certs
set mailcap_path = ~/.config/neomutt/mailcap # entries for filetypes
set tmpdir = ~/.config/neomutt/temp # where to keep temp files
set folder = $HOME/.local/share/mails # mail location
set alias_file = $HOME/.config/neomutt/alias # where to store aliases
set header_cache = $HOME/.config/neomutt/cache/headers # where to store headers
set message_cachedir = $HOME/.config/neomutt/cache/bodies # where to store bodies
set certificate_file = $HOME/.config/neomutt/certificates # where to store certs
set mailcap_path = $HOME/.config/neomutt/mailcap # entries for filetypes
set tmpdir = $HOME/.config/neomutt/temp # where to keep temp files
#+END_SRC
** Print
@@ -875,8 +941,8 @@ set spoolfile = "+esrf/Inbox" # Default inbox
set realname = "Dehaeze Thomas"
set from = "thomas.dehaeze@esrf.fr"
folder-hook gmail/* source ~/.config/neomutt/accounts/gmail
folder-hook esrf/* source ~/.config/neomutt/accounts/esrf
folder-hook gmail/* source $HOME/.config/neomutt/accounts/gmail
folder-hook esrf/* source $HOME/.config/neomutt/accounts/esrf
macro index,pager ge "<change-folder>+esrf/Inbox<enter>" "go to inbox"
macro index,pager gm "<change-folder>+gmail/Inbox<enter>" "go to inbox"
@@ -886,7 +952,7 @@ macro index,pager gm "<change-folder>+gmail/Inbox<enter>" "go to inbox"
**** Configuration
#+begin_src conf :tangle ~/.config/neomutt/accounts/gmail :comments none
set from = "dehaeze.thomas@gmail.com"
set sendmail = "~/.config/neomutt/bin/send_mail.sh gmail"
set sendmail = "$HOME/.config/neomutt/bin/send_mail.sh gmail"
# Other special folders.
set mbox = "+gmail/Archive" # Archive Box
@@ -894,7 +960,7 @@ set postponed = "+gmail/Drafts"
unset record # Don't copy send message to Sent folder: Gmail does that for us
set signature = "~/.config/neomutt/accounts/gmail.signature"
set signature = "$HOME/.config/neomutt/accounts/gmail.signature"
macro index,pager d \
"<save-message>+gmail/Archive<enter>" \
@@ -917,14 +983,14 @@ This empty code block is used to add a new line after signature
**** Configuration
#+begin_src conf :tangle ~/.config/neomutt/accounts/esrf :comments none
set from = "thomas.dehaeze@esrf.fr"
set sendmail = "~/.config/neomutt/bin/send_mail.sh esrf"
set sendmail = "$HOME/.config/neomutt/bin/send_mail.sh esrf"
# Other special folders.
set mbox = "+esrf/Archive"
set record = "+esrf/Sent"
set postponed = "+esrf/Drafts"
set signature = "~/.config/neomutt/accounts/esrf.signature"
set signature = "$HOME/.config/neomutt/accounts/esrf.signature"
macro index,pager d \
"<save-message>+esrf/Archive<enter>" \
@@ -1091,22 +1157,23 @@ set sidebar_format = '%D %* %?N?[%N]?'
# path - mailbox path
# unsorted - do not sort the mailboxes
set sidebar_sort_method = 'unsorted'
set sort_browser = 'unsorted'
#+END_SRC
*** Mailboxes to show in the sidebar.
#+BEGIN_SRC conf
named-mailboxes " Search" =search
named-mailboxes " Search" =search
named-mailboxes " GMAIL" =empty/gmail
named-mailboxes "  Inbox" =gmail/Inbox
named-mailboxes "  Sent" =gmail/Sent
named-mailboxes "  Drafts" =gmail/Drafts
named-mailboxes " Archive" =gmail/Archive
named-mailboxes " Archive" =gmail/Archive
named-mailboxes "  Trash" =gmail/Trash
named-mailboxes " ESRF" =empty/esrf
named-mailboxes "  Inbox" =esrf/Inbox
named-mailboxes "  Sent" =esrf/Sent
named-mailboxes "  Drafts" =esrf/Drafts
named-mailboxes " Archive" =esrf/Archive
named-mailboxes " Archive" =esrf/Archive
named-mailboxes "  Trash" =esrf/Trash
#+END_SRC
@@ -1129,7 +1196,7 @@ A script =openfile.sh= is used to open files with the default application using
First, tag the files you want to send using =t=, then =;= to apply the action on
all tagged files and finally =<enter>= to add them all.
Of ranger can be used with the =A= keybinding.
Or yazi can be used with the =A= keybinding.
*** Forgotten Attachment
#+begin_src conf
@@ -1145,16 +1212,16 @@ set abort_noattach_regex = "\\<(attach(|ed|ments?)|(attaché|attachés|attache|a
*** Search Mail
#+begin_src bash :tangle ~/.config/neomutt/bin/search_mail.sh
arg_subject=$(rofi -p "Search" -dmenu)
arg_subject=$(rofi -p "Contains" -dmenu)
arg_from=$(rofi -p "From" -dmenu)
if [ ! -z "$arg_from" ]; then
arg_from="from:${arg_from}"
arg_from="from:/.*${arg_from}.*/"
fi
arg_to=$(rofi -p "To" -dmenu)
if [ ! -z "$arg_to" ]; then
arg_to="to:${arg_to}"
arg_to="to:/.*${arg_to}.*/"
fi
arg_mime=$(echo -e "\napplication/pdf\nimage/*\nvideo/*" | rofi -i -p "Mime" -dmenu)
@@ -1162,16 +1229,16 @@ if [ ! -z "$arg_mime" ]; then
arg_mime="mime:${arg_mime}"
fi
mu find --clearlinks --format=links --linksdir=~/.mail/search "${arg_from} ${arg_to} ${arg_mime} ${arg_subject}"
mu find --clearlinks --format=links --linksdir=$HOME/.local/share/mails/search "${arg_from} ${arg_to} ${arg_mime} ${arg_subject}"
#+end_src
*** Send Mail Script
*** Sync "Send Mail" Script
#+begin_src bash :tangle ~/.config/neomutt/bin/send_mail.sh
msmtp -a $1 ${@:2} && \
if [ $TMUX ]; then
tmux split -v -l 1 mbsync $1-Sent && tmux select-pane -U
tmux split -v -l 1 "mbsync -c $XDG_CONFIG_HOME/isync/mbsyncrc $1-Sent && mu index" && tmux select-pane -U
else
mbsync $1-Sent
mbsync -c $XDG_CONFIG_HOME/isync/mbsyncrc $1-Sent && mu index
fi
#+end_src
@@ -1184,6 +1251,316 @@ else
fi
#+end_src
*** Sync ESRF Mail Script
#+begin_src bash :tangle ~/.config/neomutt/bin/get_new_esrf_mail.sh
if [ $TMUX ]; then
tmux split -v -l 1 "mbsync -c $XDG_CONFIG_HOME/isync/mbsyncrc esrf && mu index" && tmux select-pane -U
else
mbsync -c $XDG_CONFIG_HOME/isync/mbsyncrc esrf && mu index
fi
#+end_src
*** Email written with Org-Mode
#+begin_src bash :tangle ~/.config/neomutt/bin/convert-multipart.sh
commandsFile="/tmp/neomutt-commands"
orgFile="/tmp/neomutt-org"
htmlFile="/tmp/neomutt.html"
debugFile="/tmp/neomutt-debug.txt"
: > "$debugFile" # clear previous content
# Save original
cat - > "${orgFile}.orig"
cp "${orgFile}.orig" "$orgFile"
# Reset commands
echo -n "push " > "$commandsFile"
# -----------------------------
# Replace signature for HTML only
# -----------------------------
awk '
/^-- *$/ {
in_sig = 1
sig = "--"
next
}
in_sig {
if (/^[[:space:]]*$/) {
print "#+begin_export html"
gsub(/\n/, "<br>", sig)
print "<p style=\"margin-top:1.2em; font-size:90%; color:#444; line-height:1.3;\">" sig "</p>"
print "#+end_export"
print
in_sig = 0
} else {
sig = sig "<br>" $0
}
next
}
{print}
' "$orgFile" > "$orgFile.tmp" && mv "$orgFile.tmp" "$orgFile"
# -----------------------------
# Convert Org to HTML
# -----------------------------
pandoc -f org -t html5 --standalone --wrap=none --template ~/.local/share/pandoc/email.html \
"$orgFile" > "$htmlFile"
# -----------------------------
# Helper: extract local images from HTML
# -----------------------------
grep -oP '<img src="file://\K[^"]+' "$htmlFile" | while read -r file; do
sed -i "s#<img src=\"file://$file\"#<img src=\"cid:$(md5sum "$file" | cut -d ' ' -f 1 )\"#g" "$htmlFile"
echo "Replaced $file by cid:$(md5sum "$file" | cut -d ' ' -f 1 ) in HTML" >> "$debugFile"
done
# Attach the html file
echo -n "<attach-file>\"$htmlFile\"<enter>" >> "$commandsFile"
# Set it as inline
echo -n "<toggle-disposition>" >> "$commandsFile"
# Tell neomutt to delete it after sending
echo -n "<toggle-unlink>" >> "$commandsFile"
# Select both the html and org files
echo -n "<tag-entry><previous-entry><tag-entry>" >> "$commandsFile"
# Group the selected messages as alternatives
echo -n "<group-alternatives>" >> "$commandsFile"
grep -oP '\[\[file:\K[^\]]+' "${orgFile}.orig" \
| grep -Ev '^(https?://|cid:)' \
| while read -r file; do
if [[ -f "$file" ]]; then
id="$(md5sum "$file" | cut -d ' ' -f 1 )"
echo -n "<attach-file>\"$file\"<enter>" >> "$commandsFile"
echo -n "<toggle-disposition>" >> "$commandsFile"
echo -n "<edit-content-id><backspace><backspace><backspace><backspace><backspace><backspace><backspace><backspace><backspace><backspace><backspace><backspace><backspace><backspace><backspace><backspace>$id<enter>" >> "$commandsFile"
echo -n "<tag-entry>" >> "$commandsFile"
echo "Attached $file" >> "$debugFile"
fi
done
grep -oP '\[\[file:\K[^\]]+' "$orgFile" | grep '^cid:' >/dev/null
if [[ $? -eq 0 ]]; then
echo -n "<first-entry><tag-entry><group-related>" >> "$commandsFile"
echo "Grouped related images" >> "$debugFile"
fi
#+end_src
#+begin_src html :tangle ~/.local/share/pandoc/email.html :shebang "" :comments no
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>$if(title-prefix)$$title-prefix$ $endif$$pagetitle$</title>
<style type="text/css">
/* ------------------------------ */
/* Base reset for email clients */
/* ------------------------------ */
body,table,td,div,p {
margin:0;
padding:0;
font-family: Georgia, "Times New Roman", serif;
font-size: 15px;
line-height: 1.4;
color:#111;
}
img {
border:0;
outline:none;
text-decoration:none;
max-width:100%;
height:auto;
-ms-interpolation-mode:bicubic; /* Outlook */
}
table {
border-collapse: collapse;
}
/* ------------------------------ */
/* Layout container */
/* ------------------------------ */
.wrapper {
width:100%;
background:#ffffff;
padding:20px 0;
}
.container {
max-width:760px;
margin:0 auto;
padding:20px;
background:#ffffff;
}
/* ------------------------------ */
/* Typography */
/* ------------------------------ */
h1,h2,h3,h4,h5,h6 {
margin:20px 0 10px;
font-family: "Roboto","Helvetica Neue","Segoe UI",Arial,sans-serif;
color:#222;
line-height:1.25;
}
h1 { font-size: 22px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
h4 { font-size: 15px; }
h5 { font-size: 14px; }
h6 { font-size: 13px; }
p {
margin:12px 0;
}
ul,ol {
margin:10px 0 10px 25px;
}
li { margin:4px 0; }
/* ------------------------------ */
/* Code blocks & inline code */
/* ------------------------------ */
pre, code {
font-family: Menlo, Consolas, "Courier New", monospace;
font-size: 13px;
}
pre {
background:#f5f5f5;
padding:10px;
border-radius:4px;
white-space:pre-wrap;
margin:15px 0;
}
p > code {
background:#f5f5f5;
padding:2px 4px;
border-radius:3px;
}
/* ------------------------------ */
/* Blockquotes */
/* ------------------------------ */
blockquote {
border-left:4px solid #ccc;
padding-left:10px;
margin-left:5px;
margin-right:0;
font-style:italic;
color:#555;
}
/* ------------------------------ */
/* Tables */
/* ------------------------------ */
table {
width: 100%;
border-collapse: collapse;
margin: 15px 0;
font-size: 14px;
line-height: 1.4;
}
table th, table td {
border: 1px solid #ccc;
padding: 8px 12px;
text-align: left;
}
table th {
background-color: #f0f0f0;
font-weight: bold;
}
table tr:nth-child(even) {
background-color: #fafafa;
}
table caption {
caption-side: bottom;
font-size: 12px;
color: #555;
margin-top: 5px;
}
/* ------------------------------ */
/* Mobile styles */
/* ------------------------------ */
@media only screen and (max-width: 620px) {
body,table,td,p { font-size:14px !important; }
h1 { font-size:20px !important; }
.container { padding:15px !important; }
}
@media only screen and (max-width: 620px) {
table, thead, tbody, th, td, tr {
display: block;
width: 100%;
}
th {
text-align: right;
padding-right: 10px;
}
td {
text-align: left;
padding-left: 10px;
border: none;
border-bottom: 1px solid #eee;
}
}
</style>
$if(highlighting-css)$
<style type="text/css">
$highlighting-css$
</style>
$endif$
$for(header-includes)$
$header-includes$
$endfor$
</head>
<body>
<div class="wrapper">
<div class="container">
$if(title)$
<h1>$title$</h1>
$endif$
$body$
</div>
</div>
</body>
</html>
#+end_src
*** Openfile Scripts
#+begin_src bash :tangle ~/.config/neomutt/bin/openfile.sh
base=$(basename "$1")
@@ -1220,7 +1597,7 @@ Generic
#+BEGIN_SRC conf
text/plain; nvim %s
video/*; setsid mpv --quiet %s &
image/*; sxiv -a -b %s &
image/*; nsxiv -a -b %s &
application/pdf; zathura %s &
audio/*; /usr/bin/xdg-open %s; copiousoutput
text/html; export DISPLAY=:0 && setsid qutebrowser %s > /dev/null 2>&1 &; nametemplate=%s.html
@@ -1233,73 +1610,78 @@ text/calendar; ics-add %s; copiousoutput;
application/ics; ics-add %s; copiousoutput;
#+END_SRC
For calendar output (outlook), a personal =ics-add= script is used.
#+BEGIN_SRC conf
application/ms-tnef; winmail-add %s; copiousoutput;
#+END_SRC
Libreoffice
#+begin_src conf
application/docx; libreoffice %s --nologo &; copiousoutput;
application/doc; libreoffice --nologo %s &; copiousoutput;
application/docx; onlyoffice-desktopeditors %s &; copiousoutput;
application/doc; onlyoffice-desktopeditors %s &; copiousoutput;
application/vnd.oasis.opendocument.database; libreoffice --nologo --base '%s'; copiousoutput
application/vnd.oasis.opendocument.chart; libreoffice --nologo --calc '%s'; copiousoutput
application/vnd.oasis.opendocument.spreadsheet; libreoffice --nologo --calc '%s'; copiousoutput
application/vnd.oasis.opendocument.spreadsheet-template; libreoffice --nologo --calc '%s'; copiousoutput
application/vnd.oasis.opendocument.graphics; libreoffice --nologo --draw '%s'; copiousoutput
application/vnd.oasis.opendocument.graphics-template; libreoffice --nologo --draw '%s'; copiousoutput
application/vnd.oasis.opendocument.presentation; libreoffice --nologo --impress '%s'; copiousoutput
application/vnd.oasis.opendocument.presentation-template; libreoffice --nologo --impress '%s'; copiousoutput
application/vnd.oasis.opendocument.formula; libreoffice --nologo --math '%s'; copiousoutput
application/vnd.oasis.opendocument.text; libreoffice --nologo --writer '%s'; copiousoutput
application/vnd.oasis.opendocument.text-master; libreoffice --nologo -global '%s'; copiousoutput
application/vnd.oasis.opendocument.text-template; libreoffice --nologo --writer '%s'; copiousoutput
application/vnd.oasis.opendocument.text-web; libreoffice --nologo -web '%s'; copiousoutput
application/vnd.sun.xml.base; libreoffice --nologo --writer '%s'; copiousoutput
application/vnd.sun.xml.calc; libreoffice --nologo --calc '%s'; copiousoutput
application/vnd.sun.xml.calc.template; libreoffice --nologo --calc '%s'; copiousoutput
application/vnd.sun.xml.draw; libreoffice --nologo --draw '%s'; copiousoutput
application/vnd.sun.xml.draw.template; libreoffice --nologo --draw '%s'; copiousoutput
application/vnd.stardivision.calc; libreoffice --nologo --calc '%s'; copiousoutput
application/vnd.stardivision.chart; libreoffice --nologo --calc '%s'; copiousoutput
application/vnd.stardivision.draw; libreoffice --nologo --draw '%s'; copiousoutput
application/vnd.stardivision.impress; libreoffice --nologo --impress '%s'; copiousoutput
application/vnd.stardivision.math; libreoffice --nologo --math '%s'; copiousoutput
application/vnd.stardivision.writer-global; libreoffice --nologo --writer '%s'; copiousoutput
application/vnd.stardivision.writer; libreoffice --nologo --writer '%s'; copiousoutput
application/vnd.sun.xml.impress; libreoffice --nologo --impress '%s'; copiousoutput
application/vnd.sun.xml.impress.template; libreoffice --nologo --impress '%s'; copiousoutput
application/vnd.sun.xml.math; libreoffice --nologo --math '%s'; copiousoutput
application/vnd.sun.xml.writer; libreoffice --nologo --writer '%s'; copiousoutput
application/vnd.sun.xml.writer.global; libreoffice --nologo -global '%s'; copiousoutput
application/vnd.sun.xml.writer.template; libreoffice --nologo --writer '%s'; copiousoutput
text/csv; libreoffice --nologo --calc '%s'; copiousoutput
text/spreadsheet; libreoffice --nologo --calc '%s'; copiousoutput
application/x-quattropro; libreoffice --nologo --calc '%s'; copiousoutput
application/x-dbf; libreoffice --nologo --calc '%s'; copiousoutput
application/vnd.ms-excel.sheet.macroEnabled.12; libreoffice --nologo --calc '%s'; copiousoutput
application/vnd.ms-excel.template.macroEnabled.12; libreoffice --nologo --calc '%s'; copiousoutput
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; libreoffice --nologo --calc '%s'; copiousoutput
application/vnd.openxmlformats-officedocument.spreadsheetml.template; libreoffice --nologo --calc '%s'; copiousoutput
application/vnd.lotus-1-2-3; libreoffice --nologo --calc '%s'; copiousoutput
application/vnd.ms-excel; libreoffice --nologo --calc '%s'; copiousoutput
application/msexcel; libreoffice --nologo --calc '%s'; copiousoutput
application/x-dbase; libreoffice --nologo --calc '%s'; copiousoutput
text/x-csv; libreoffice --nologo --calc '%s'; copiousoutput
application/vnd.ms-powerpoint.presentation.macroEnabled.12; libreoffice --nologo --impress '%s'; copiousoutput
application/vnd.ms-powerpoint.slideshow.macroEnabled.12; libreoffice --nologo --impress '%s'; copiousoutput
application/vnd.ms-powerpoint.template.macroEnabled.12; libreoffice --nologo --impress '%s'; copiousoutput
application/vnd.openxmlformats-officedocument.presentationml.presentation; libreoffice --nologo --impress '%s'; copiousoutput
application/vnd.openxmlformats-officedocument.presentationml.slideshow; libreoffice --nologo --impress '%s'; copiousoutput
application/vnd.openxmlformats-officedocument.presentationml.template; libreoffice --nologo --impress '%s'; copiousoutput
application/vnd.ms-powerpoint; libreoffice --nologo --impress '%s'; copiousoutput
application/mspowerpoint; libreoffice --nologo --impress '%s'; copiousoutput
text/mathml; libreoffice --nologo --math '%s'; copiousoutput
application/rtf; libreoffice --nologo --writer '%s'; copiousoutput
application/x-t602; libreoffice --nologo --writer '%s'; copiousoutput
application/vnd.wordperfect; libreoffice --nologo --writer '%s'; copiousoutput
application/vnd.ms-word.document.macroEnabled.12; libreoffice --nologo --writer '%s'; copiousoutput
application/vnd.ms-word.template.macroEnabled.12; libreoffice --nologo --writer '%s'; copiousoutput
application/vnd.openxmlformats-officedocument.wordprocessingml.document; libreoffice --nologo --writer '%s'; copiousoutput
application/vnd.openxmlformats-officedocument.wordprocessingml.template; libreoffice --nologo --writer '%s'; copiousoutput
application/vnd.ms-works; libreoffice --nologo --writer '%s'; copiousoutput
application/msword; libreoffice --nologo --writer '%s'; copiousoutput
application/wordperfect; libreoffice --nologo --writer '%s'; copiousoutput
text/rtf; libreoffice --nologo --writer '%s'; copiousoutput
application/vnd.oasis.opendocument.database; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.oasis.opendocument.chart; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.oasis.opendocument.spreadsheet; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.oasis.opendocument.spreadsheet-template; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.oasis.opendocument.graphics; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.oasis.opendocument.graphics-template; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.oasis.opendocument.presentation; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.oasis.opendocument.presentation-template; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.oasis.opendocument.formula; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.oasis.opendocument.text; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.oasis.opendocument.text-master; onlyoffice-desktopeditors -global '%s'; copiousoutput
application/vnd.oasis.opendocument.text-template; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.oasis.opendocument.text-web; onlyoffice-desktopeditors -web '%s'; copiousoutput
application/vnd.sun.xml.base; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.sun.xml.calc; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.sun.xml.calc.template; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.sun.xml.draw; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.sun.xml.draw.template; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.stardivision.calc; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.stardivision.chart; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.stardivision.draw; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.stardivision.impress; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.stardivision.math; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.stardivision.writer-global; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.stardivision.writer; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.sun.xml.impress; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.sun.xml.impress.template; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.sun.xml.math; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.sun.xml.writer; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.sun.xml.writer.global; onlyoffice-desktopeditors -global '%s'; copiousoutput
application/vnd.sun.xml.writer.template; onlyoffice-desktopeditors '%s'; copiousoutput
text/csv; onlyoffice-desktopeditors '%s'; copiousoutput
text/spreadsheet; onlyoffice-desktopeditors '%s'; copiousoutput
application/x-quattropro; onlyoffice-desktopeditors '%s'; copiousoutput
application/x-dbf; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.ms-excel.sheet.macroEnabled.12; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.ms-excel.template.macroEnabled.12; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.openxmlformats-officedocument.spreadsheetml.template; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.lotus-1-2-3; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.ms-excel; onlyoffice-desktopeditors '%s'; copiousoutput
application/msexcel; onlyoffice-desktopeditors '%s'; copiousoutput
application/x-dbase; onlyoffice-desktopeditors '%s'; copiousoutput
text/x-csv; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.ms-powerpoint.presentation.macroEnabled.12; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.ms-powerpoint.slideshow.macroEnabled.12; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.ms-powerpoint.template.macroEnabled.12; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.openxmlformats-officedocument.presentationml.presentation; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.openxmlformats-officedocument.presentationml.slideshow; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.openxmlformats-officedocument.presentationml.template; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.ms-powerpoint; onlyoffice-desktopeditors '%s'; copiousoutput
application/mspowerpoint; onlyoffice-desktopeditors '%s'; copiousoutput
text/mathml; onlyoffice-desktopeditors '%s'; copiousoutput
application/rtf; onlyoffice-desktopeditors '%s'; copiousoutput
application/x-t602; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.wordperfect; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.ms-word.document.macroEnabled.12; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.ms-word.template.macroEnabled.12; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.openxmlformats-officedocument.wordprocessingml.document; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.openxmlformats-officedocument.wordprocessingml.template; onlyoffice-desktopeditors '%s'; copiousoutput
application/vnd.ms-works; onlyoffice-desktopeditors '%s'; copiousoutput
application/msword; onlyoffice-desktopeditors '%s'; copiousoutput
application/wordperfect; onlyoffice-desktopeditors '%s'; copiousoutput
text/rtf; onlyoffice-desktopeditors '%s'; copiousoutput
#+end_src

View File

@@ -15,7 +15,7 @@ And then to perform the update:
paru
#+end_src
** NPM
** NPM (nodejs)
First update =npm= itself
#+begin_src bash
sudo npm install npm@latest -g
@@ -31,20 +31,9 @@ And finally perform the update:
sudo npm update -g
#+end_src
** PIP
First upgrade =pip= itself:
** PIP (python)
#+begin_src bash
/usr/bin/python3 -m pip install --upgrade pip
#+end_src
Then list outdated packages:
#+begin_src bash
pip3 list --outdated
#+end_src
And update everything with:
#+begin_src bash
pip3 list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip3 install -U
/usr/bin/python3 -m pipx upgrade-all
#+end_src
** Emacs and Vim

View File

@@ -7,7 +7,7 @@
* Startup
:PROPERTIES:
:HEADER-ARGS:matlab+: :tangle ~/Documents/MATLAB/startup.m
:HEADER-ARGS:matlab+: :tangle ~/.config/matlab/startup.m
:END:
** Setup LaTeX as a default interpreter
@@ -16,7 +16,6 @@ set(groot, 'DefaultTextInterpreter', 'LaTeX');
set(groot, 'DefaultAxesTickLabelInterpreter', 'LaTeX');
set(groot, 'DefaultAxesFontName', 'LaTeX');
set(groot, 'DefaultLegendInterpreter', 'LaTeX');
set(groot, 'DefaultConstantLineInterpreter', 'LaTeX');
#+end_src
** Default Line Width
@@ -39,14 +38,12 @@ set(groot, 'DefaultTextFontSize', 10);
set(groot, 'DefaultAxesFontUnits', 'points');
set(groot, 'DefaultAxesFontSize', 10);
set(groot, 'DefaultUicontrolFontSize', 10);
set(groot, 'DefaultConstantLineFontSize', 10);
#+end_src
** Default Fonts
#+begin_src matlab
set(groot, 'DefaultAxesFontName', 'Helvetica');
set(groot, 'DefaultTextFontName', 'Helvetica');
set(groot, 'DefaultConstantLineFontName', 'Helvetica');
#+end_src
** Make figures into a Box
@@ -88,6 +85,13 @@ format compact;
format long g;
#+end_src
** Change TMPDIR to deal with Archlinux issue
See https://fr.mathworks.com/matlabcentral/answers/1798895-invalid-cross-device-link-18-when-saving-a-file-on-arch-linux?s_tid=srchtitle
#+begin_src matlab
setenv('TMPDIR', '/home/thomas/.cache')
#+end_src
** Home Path
#+begin_src matlab
toolboxes_path = '~/Cloud/programming/matlab/';
@@ -154,6 +158,12 @@ Toolbox to work with fractional order models ([[https://github.com/extall/fomcon
addpath(genpath([toolboxes_path 'fomcon-matlab']))
#+end_src
** Bliss
#+begin_src matlab
addpath('~//Cloud/work-projects/Speedgoat/Speedgoat_Bliss/matlab')
addpath('~//Cloud/work-projects/Speedgoat/Speedgoat_Bliss/library')
#+end_src
** Clear
#+begin_src matlab
clear;
@@ -161,7 +171,7 @@ clear;
* Setup
:PROPERTIES:
:HEADER-ARGS:matlab+: :tangle ~/Documents/MATLAB/setup.m
:HEADER-ARGS:matlab+: :tangle ~/.config/matlab/setup.m
:END:
This script should be run once after Matlab is installed.

126
music.org
View File

@@ -1,23 +1,7 @@
#+TITLE: Music/Sound Configuration
#+SETUPFILE: ./setup/org-setup-file.org
* =pavucontrol= - Volume Control
:PROPERTIES:
:header-args: :tangle ~/.config/pavucontrol.ini
:header-args+: :comments both :mkdirp yes
:CUSTOM_ID: pavucontrol
:END:
#+BEGIN_SRC conf
[window]
width=500
height=400
sinkInputType=1
sourceOutputType=1
sinkType=0
sourceType=1
showVolumeMeters=1
#+END_SRC
* =pwvucontrol= - Volume Control for Pipewire
* =mopidy= - Music Server
:PROPERTIES:
@@ -26,7 +10,36 @@ showVolumeMeters=1
:CUSTOM_ID: mopidy
:END:
Things done to get mopidy to work:
#+begin_src bash :eval no :tangle no
cd ~/.local/soft/
git clone git@github.com:jellyfin/mopidy-jellyfin.git && cd mopidy-jellyfin
python -m venv env --system-site-packages
env/bin/python setup.py develop
env/bin/pip install mopidy-mpd
#+end_src
To run mopidy:
#+begin_src bash :eval no :tangle no
~/.local/soft/mopidy-jellyfin/env/bin/mopidy
#+end_src
#+begin_src conf
[core]
cache_dir = ~/.cache/mopidy
config_dir = ~/.config/mopidy
data_dir = ~/.local/data/mopidy
[audio]
output = queue2 max-size-buffers=20000 max-size-time=0 max-size-bytes=0 ! audioconvert ! pulsesink
[stream]
enabled = true
protocols =
http
https
timeout = 30000
[mpd]
enabled = true
hostname = 127.0.0.1
@@ -45,23 +58,14 @@ password = <<get-password(passname="music.tdehaeze.xyz/tdehaeze")>>
libraries = Music
albumartistsort = True
album_format = {ProductionYear} - {Name}
max_bitrate = 10000
[file]
enabled = true
media_dirs = /home/thomas/Music
excluded_file_extensions =
.db
.directory
.html
.jpeg
.jpg
.log
.nfo
.pdf
.png
.txt
.zip
enabled = false
[logging]
verbosity = 4
format = %(levelname)-8s %(asctime)s [%(process)d:%(threadName)s] %(name)s\n %(message)s
color = true
#+end_src
* =ncmpcpp= - Ncurses based MPD client
@@ -81,6 +85,7 @@ Cheatsheet: https://pkgbuild.com/~jelle/ncmpcpp/
Configuration directory.
#+begin_src conf
ncmpcpp_directory = ~/.config/ncmpcpp
lyrics_directory = ~/.local/share/lyrics
#+end_src
MPD Configuration.
@@ -92,7 +97,7 @@ mpd_music_dir = ~/Music
Notification of song change.
#+begin_src conf
execute_on_song_change = notify-send --hint=string:x-dunst-stack-tag:Z7uCd3ZP "Now Playing ♫" "$(mpc current)"
execute_on_song_change = dunstify --replace=19845 "Now Playing ♫" "$(mpc current)"
#+end_src
Better user interface
@@ -104,6 +109,11 @@ browser_display_mode = "columns"
playlist_display_mode = "columns"
#+end_src
Lyrics
#+begin_src conf
lyrics_fetchers = musixmatch, sing365, metrolyrics, justsomelyrics, jahlyrics, plyrics, tekstowo, zeneszoveg, internet
#+end_src
Sorting by tracking number and then title
#+begin_src conf
browser_sort_mode = "format"
@@ -157,54 +167,4 @@ def_key "+"
volume_up
def_key "-"
volume_down
#+end_src
* =beets= - Media library management
:PROPERTIES:
:header-args:conf: :tangle ~/.config/beets/config.yaml
:header-args:conf+: :comments both :mkdirp yes
:CUSTOM_ID: beets
:END:
http://beets.io/
#+begin_src conf
directory: ~/Music
library: ~/Music/musiclibrary.db
art_filename: cover
import:
move: yes
plugins: fromfilename discogs
#+end_src
* =curseradio= - Radio with curseradio
:PROPERTIES:
:header-args:conf: :tangle ~/.config/curseradio/curseradio.cfg
:header-args:conf+: :comments none :mkdirp yes
:CUSTOM_ID: curseradio
:END:
#+begin_src conf
[opml]
root = http://opml.radiotime.com/
[playback]
command = /usr/bin/mpv
[interface]
keymap = vi
[keymap.vi]
up = k
down = j
start = 0
end = $
pageup = u
pagedown = d
enter = l
stop = p
exit = q
favourite = f
#+end_src

View File

@@ -1,498 +0,0 @@
#+TITLE: Newsboat Configuration
#+SETUPFILE: ./setup/org-setup-file.org
https://wiki.archlinux.org/index.php/Newsboat
https://newsboat.org/releases/2.12/docs/newsboat.html
* Config
:PROPERTIES:
:header-args: :tangle ~/.config/newsboat/config
:header-args+: :comments both :mkdirp yes
:END:
** Reload configuration
#+BEGIN_SRC conf
# All feeds will be automatically reloaded after a certain time has passed
auto-reload yes
# The number of minutes between automatic reloads.
reload-time 120
# The number of parallel reload threads that shall be started when all feeds are reloaded.
reload-threads 3
# If set to yes, then the first automatic reload will be suppressed if auto-reload is set to yes.
suppress-first-reload yes
#+END_SRC
** Basic configuration
#+BEGIN_SRC conf
confirm-exit no
external-url-viewer "urlscan -dc -r 'linkhandler {}'"
goto-first-unread no
goto-next-feed no
save-path "~/Documents/newsboat/saved"
download-path "~/Documents/newsboat/downloaded"
# If set to no, then the keymap hints on the bottom of screen will not be displayed.
show-keymap-hint no
player "mpv"
#+END_SRC
** Queries
#+begin_src conf
prepopulate-query-feeds yes
#+end_src
** Filters
#+begin_src conf :tangle no
define-filter "Unread Articles" "unread = \"yes\""
#+end_src
** Notifications
#+BEGIN_SRC conf
notify-format "%n unread articles"
notify-program ~/.config/newsboat/scripts/newsboat-notify.sh
notify-always no
#+END_SRC
*** Notification Script
:PROPERTIES:
:header-args: :tangle ~/.config/newsboat/scripts/newsboat-notify.sh
:header-args+: :comments both :mkdirp yes
:header-args+: :shebang "#!/usr/bin/env bash"
:END:
#+begin_src bash
notify-send "Newsboat " "$1"
#+end_src
** Bindings
#+BEGIN_SRC conf
bind-key j down
bind-key k up
bind-key j next articlelist
bind-key k prev articlelist
bind-key J next-feed articlelist
bind-key K prev-feed articlelist
bind-key G end
bind-key g home
bind-key ^D pagedown
bind-key ^U pageup
bind-key q toggle-show-read-feeds
bind-key Q quit
bind-key l open
bind-key h quit
bind-key a toggle-article-read
bind-key n next-unread
bind-key N prev-unread
bind-key D pb-download
bind-key U show-urls
bind-key t set-tag
bind-key T clear-tag
bind-key r reload # Reload the currently selected feed
bind-key R reload-all # Reload all feeds
#+END_SRC
** Bookmarking
#+begin_src conf
bookmark-autopilot no
bookmark-cmd "~/.config/newsboat/scripts/buku-add.sh"
bookmark-interactive no
#+end_src
*** Buku Scripts
:PROPERTIES:
:header-args: :tangle ~/.config/newsboat/scripts/buku-add.sh
:header-args+: :comments both :mkdirp yes
:header-args+: :shebang "#!/usr/bin/env bash"
:END:
#+begin_src bash
buku --add "$1" --title "$2" --comment "$3" && \
notify-send "Buku" "Bookmark Added" && \
exit 0
#+end_src
** Macros - Starts with , key
#+BEGIN_SRC conf
# Default Browser
browser linkhandler
# Open in Browser
macro , open-in-browser
# Download Video with Youtube-DL
macro v set browser "cd ~/Documents/to-watch && ~/.local/bin/yt-video %u" ; open-in-browser ; set browser linkhandler
# Download Audio with Youtube-DL
macro a set browser "cd ~/Documents/to-watch && ~/.local/bin/yt-audio %u" ; open-in-browser ; set browser linkhandler
# Open Video with MPV
macro m set browser "setsid nohup mpv %u &> /dev/null &" ; open-in-browser ; set browser linkhandler
# Open With W3M
macro w set browser "w3m %u" ; open-in-browser ; set browser linkhandler
# Copy Address to clipboard
macro c set browser "xsel -b <<<" ; open-in-browser ; set browser linkhandler
# Quit
macro q set browser "tmux detach" ; open-in-browser ; set browser linkhandler
#+END_SRC
** hide articles matching
#+BEGIN_SRC conf :tangle no
ignore-article "*" "title =~ \"Sponsor\""
ignore-article "*" "title =~ \"Advertisement\""
ignore-mode "display"
#+END_SRC
** Feedlist and Article Format
#+BEGIN_SRC conf
feedlist-format "%4i %n %11u %t"
feedlist-title-format "N %V - Your feeds (%u unread, %t total)%?T? - tag `%T'&?"
articlelist-format "%3i %f %D %?T?|%-17T| ?%t"
articlelist-title-format "%N %V - Articles in feed '%T' (%u unread, %t total) - %U"
itemview-title-format "Article '%T'"
#+END_SRC
** Color Scheme
#+BEGIN_SRC conf
include "~/.config/newsboat/colors"
#+END_SRC
* Colors
:PROPERTIES:
:header-args: :tangle ~/.config/newsboat/colors
:header-args+: :comments both :mkdirp yes
:END:
#+BEGIN_SRC conf
color background default default
color listnormal default default
color listnormal_unread default default
color listfocus black yellow
color listfocus_unread black yellow
color info default black
color article default default
# highlights
highlight article "^(Title):.*$" blue default
highlight article "https?://[^ ]+" red default
highlight article "\\[image\\ [0-9]+\\]" green default
#+END_SRC
* URLS
:PROPERTIES:
:header-args: :tangle ~/.config/newsboat/urls
:header-args+: :comments both :mkdirp yes
:END:
** Queries
#+begin_src conf :tangle no
"query:Unread:unread = \"yes\""
"query:Unwatch - Youtube:unread = \"yes\" and tags # \"youtube\""
"query:Unread - Linux:unread = \"yes\" and tags # \"linux\""
"query:Unread - Emacs:unread = \"yes\" and tags # \"emacs\""
"query:Unread - Sciences:unread = \"yes\" and tags # \"science\""
#+end_src
** Newsfeeds
*** Matlab and Control
#+begin_src conf
https://undocumentedmatlab.com/feed/ "~RSS undocumentedmatlab" matlab
http://blogs.mathworks.com/seth/feed/ "~RSS Guy on Simulink" matlab control
http://blogs.mathworks.com/loren/?feed=rss2 "~RSS Loren on the Art of MATLAB" matlab
http://blogs.mathworks.com/pick/feed/ "~RSS File Exchange Pick of the Week" matlab
https://enriquedelsol.com/feed/ "~RSS Enrique del Sol" control
http://brettbeauregard.com/blog/feed/ "~RSS Project Blog" control
https://mburkeonmbd.com/feed/ "~RSS Model-Based Design" control matlab
https://medium.com/feed/@mithi "~RSS Medium - Mithi" control
#+end_src
*** Audio and Electronics
#+begin_src conf
http://jipihorn.wordpress.com/feed/ "~RSS Jipihorn's Blog" electronics audio
https://quantasylum.com/blogs/news.atom "~RSS QuantAsylum" audio
https://www.scrample.xyz/index.xml "~RSS Scrample" electronics
#+end_src
*** Science
#+begin_src conf
http://sciencetonnante.wordpress.com/feed/ "~RSS Science étonnante" science
https://brushingupscience.com/feed/ "~RSS Brushing Up Science" science
#+end_src
*** Linux, Emacs and Computer Science
#+begin_src conf
https://yiufung.net/index.xml "~RSS yiufung" emacs
https://bzg.fr/index.xml "~RSS bzg" emacs
https://thomashartmann.dev/rss.xml "~RSS thomashartmann.dev" emacs linux
http://cachestocaches.com/feed/ "~RSS CachesToCaches" emacs
http://frederic.bezies.free.fr/blog/?feed=rss2 "~RSS Le Weblog de Frederic Bezies" linux
https://la-bibliotex.fr/feed/ "~RSS La biblioTeX" latex
https://so.nwalsh.com/feed/ "~RSS so..." emacs
http://karl-voit.at/feeds/lazyblorg-all.atom_1.0.links-and-content.xml "~RSS Public Voit" emacs
https://people.umass.edu/weikaichen/index.xml "~RSS Weikai Chen" emacs
https://babbagefiles.xyz/index.xml "~RSS The Neo-Babbage Files" linux emacs
https://write.as/dani/feed/ "~RSS Dani" emacs
https://lepisma.xyz/atom.xml "~RSS Lepisma" emacs
http://kitchingroup.cheme.cmu.edu/blog/feed "~RSS The Kitchin Research Group" emacs
http://lukesmith.xyz/rss.xml "~RSS The Latest from Luke" linux
http://manuel-uberti.github.io/feed.xml "~RSS Manuel Uberti" emacs
https://lord.re/index.xml "~RSS /home/lord" linux
https://beepb00p.xyz/rss.xml "~RSS beepb00p" linux emacs
http://pragmaticemacs.com/feed/ "~RSS Pragmatic Emacs" emacs
https://jonathanabennett.github.io/rss.xml "~RSS Jonathan Bennett's Blog" emacs
https://joshrollinswrites.com/index.xml "~RSS The Art of Not Asking Why" emacs linux
http://endlessparentheses.com/atom.xml "~RSS Endless Parentheses" emacs
https://www.gonsie.com/blorg/feed.xml "~RSS Elsa Gonsiorowski" emacs
http://tiagoweber.github.io/blog.xml "~RSS Tiago Oliveira Weber" matlab emacs science
https://shreyas.ragavan.co/index.xml "~RSS Shreyas Ragavan" emacs
https://pinecast.com/feed/emacscast "~RSS EmacsCast" emacs
http://amitp.blogspot.com/feeds/posts/default "~RSS Amit's Thoughts" emacs
http://sachachua.com/wp/category/emacs/feed/ "~RSS Sacha Chua" emacs
https://cestlaz.github.io/rss.xml "~RSS C'est la Z" emacs
https://www-public.imtbs-tsp.eu/~berger_o/weblog/tag/org-mode/feed/ "~RSS WebLog Pro Olivier Berger" emacs
https://scripter.co/index.xml "~RSS A Scripter's Notes" linux emacs
https://assortedarray.com/index.xml "~RSS Assorted Array" emacs
https://www.with-emacs.com/rss.xml "~RSS with-emacs" emacs
https://linktohack.com/index.xml "~RSS QL's blog" emacs
https://itsfoss.com/feed "~RSS It's FOSS" linux
https://llazarek.com/feeds/all.rss.xml "~RSS llazarek" emacs
https://200ok.ch/rss.xml "~RSS 200ok" emacs
http://irreal.org/blog/?feed=rss2 "~RSS Irreal" emacs
https://emacs.cafe/feed.xml "~RSS Emacs café" emacs
http://vxlabs.com/feed/ "~RSS vxlabs" emacs linux
https://www.rousette.org.uk/index.xml "~RSS But she's a Girl..." emacs
https://www.anand-iyer.com/feed.xml "~RSS Anand Iyer" emacs
https://addy-dclxvi.github.io/index.xml "~RSS Addy's Blog" linux
https://ekaschalk.github.io/index.xml "~RSS Modern Emacs" emacs
http://howardism.org/index.xml "~RSS Howardism" emacs
http://xkcd.com/rss.xml "~RSS XKCD" random
https://blog.jethro.dev/index.xml "~RSS Jethro Kuan" emacs
https://lord.re/posts/index.xml "~RSS Lord~" linux
https://rgoswami.me/posts/index.xml "~RSS Rohit Goswami~" linux emacs
https://translucentink.gitlab.io/rss.xml "~RSS Translucent Ink" emacs
https://jherrlin.github.io/index.xml "~RSS Jherrlin" emacs linux
https://camsaul.com/feed.xml "~RSS Camsaul" emacs
https://ag91.github.io/rss.xml "~RSS Were Parallels Cross" emacs
# https://jonathanh.co.uk/
#+end_src
** Youtube
*** Matlab and Control
#+begin_src conf
https://www.youtube.com/feeds/videos.xml?channel_id=UCm5mt-A4w61lknZ9lCsZtBw "~YT Steve Brunton" youtube control science
https://www.youtube.com/feeds/videos.xml?channel_id=UCoUOaSVYkTV6W4uLvxvgiFA "~YT Nathan Kutz" youtube science control
https://www.youtube.com/feeds/videos.xml?channel_id=UCSlhlkPaq3RL1CP0Tv1xWBQ "~YT MIT Institute for Data, Systems, and Society" youtube science control
https://www.youtube.com/feeds/videos.xml?channel_id=UCmkP178NasnhR3TWQyyP4Gw "~YT How To Mechatronics" youtube science control
https://www.youtube.com/feeds/videos.xml?channel_id=UCGNxF654kRelnM0nKxM6QDQ "~YT Tom Oomen" youtube science control
https://www.youtube.com/feeds/videos.xml?channel_id=UCRCdl2SXma02BG384RuZPqg "~YT katkimshow" youtube science control
https://www.youtube.com/feeds/videos.xml?channel_id=UCq0imsn84ShAe9PBOFnoIrg "~YT Brian Douglas" youtube control
https://www.youtube.com/feeds/videos.xml?channel_id=UC7vVhkEfw4nOGp8TyDk7RcQ "~YT BostonDynamics" youtube control engineering
https://www.youtube.com/feeds/videos.xml?channel_id=UCPUuVY7w8brL0r__P8UBgyQ "~YT Christopher Lum" youtube matlab control
https://www.youtube.com/feeds/videos.xml?channel_id=UCNm2TzhsV5wGlFIAcpCx9hQ "~YT Jousef Murad" youtube engineering matlab
https://www.youtube.com/feeds/videos.xml?channel_id=UCMBXZxd-j6VqrynykO1dURw "~YT John Rossiter" youtube control
#+end_src
*** Audio and Electronics
#+begin_src conf
https://www.youtube.com/feeds/videos.xml?channel_id=UCI-FgEdZQxBASsm3HNcWKxQ "~YT Red Robbo's Workshop" youtube linux audio
https://www.youtube.com/feeds/videos.xml?channel_id=UCtpB66XKjAtFZfZyzmC-_Cg "~YT HexiBase" youtube audio
https://www.youtube.com/feeds/videos.xml?channel_id=UCGIr92yrDW4cRLD-QaZmS6w "~YT Ethan Winer" youtube audio
https://www.youtube.com/feeds/videos.xml?channel_id=UCslWMxX93gcaiXwxMv4asHA "~YT Jean Maurer Swiss Audio Manufacture SA" youtube audio
https://www.youtube.com/feeds/videos.xml?channel_id=UC6mzA8J7n0ylf0RnDpj-vrg "~YT PS Audio" youtube audio
https://www.youtube.com/feeds/videos.xml?channel_id=UCy0tKL1T7wFoYcxCe0xjN6Q "~YT Technology Connections" youtube audio engineering
https://www.youtube.com/feeds/videos.xml?channel_id=UCSqyMHDUsc1gs6wz4sUy91w "~YT jipihorn" youtube electronics audio
https://www.youtube.com/feeds/videos.xml?channel_id=UCOuow_HIYmeaIqi42zVs3qg "~YT Kirby Meets Audio" youtube audio
https://www.youtube.com/feeds/videos.xml?channel_id=UCWOhWAOydPUqillkpt5UlaA "~YT Dakoustics" youtube audio
https://www.youtube.com/feeds/videos.xml?channel_id=UCm2rchKqdoSKdB448TTVEnQ "~YT Impulse Audio" youtube audio
https://www.youtube.com/feeds/videos.xml?channel_id=UC5QPFDZ3Y4ylkkGJc6Y1OOA "~YT Philippe Demerliac" youtube electronics
https://www.youtube.com/feeds/videos.xml?channel_id=UCVqx3vXNghSqUcVg2nmegYA "~YT U꞊RI" youtube electronics diy
https://www.youtube.com/feeds/videos.xml?channel_id=UCUJQSGHlYC9Xyz-uNfSpSsA "~YT ElectronikHeart" youtube electronics
https://www.youtube.com/feeds/videos.xml?channel_id=UC74xmXx1NfeIIa44J1IU84w "~YT Audio Fest" youtube audio
https://www.youtube.com/feeds/videos.xml?channel_id=UCP_yR0wxxyLa46rRgsmje3Q "~YT DIY Speaker Building" youtube audio
https://www.youtube.com/feeds/videos.xml?channel_id=UCVryWqJ4cSlbTSETBHpBUWw "~YT Phil S" youtube electronics control
#+end_src
*** Linux, Emacs and Computer Science
#+begin_src conf
https://www.youtube.com/feeds/videos.xml?channel_id=UCNqFXwI5gNcyxt2c1zTQAKw "~YT Yisrael Dov L" youtube emacs
https://www.youtube.com/feeds/videos.xml?channel_id=UC2eYFnH61tmytImy1mTYvhA "~YT Luke Smith" youtube linux
https://www.youtube.com/feeds/videos.xml?channel_id=UCkf4VIqu3Acnfzuk3kRIFwA "~YT gotbletu" youtube linux
https://www.youtube.com/feeds/videos.xml?channel_id=UCVHICXXtKG7rZgtC5xonNdQ "~YT Howard Abrams" youtube emacs
https://www.youtube.com/feeds/videos.xml?channel_id=UCEfFUaIkjbI06PhALdcXNVA "~YT EmacsCast" youtube emacs
https://www.youtube.com/feeds/videos.xml?channel_id=UCzgkOWKcwy0uhYilE6bd1Lg "~YT Zaiste Programming" youtube emacs
https://www.youtube.com/feeds/videos.xml?channel_id=UC5dAH2txWtKSsgmRglRB88A "~YT kyptin" youtube emacs
https://www.youtube.com/feeds/videos.xml?channel_id=UCld68syR8Wi-GY_n4CaoJGA "~YT Brodie Robertson" youtube linux
https://www.youtube.com/feeds/videos.xml?channel_id=UCXPHFM88IlFn68OmLwtPmZA "~YT Greg Hurrell" youtube linux
https://www.youtube.com/feeds/videos.xml?channel_id=UCxjDcP3Su59bg5VDnlwyt5A "~YT Bailey Ling" youtube emacs
https://www.youtube.com/feeds/videos.xml?channel_id=UCi8XrDg1bK_MJ0goOnbpTMQ "~YT budlabs" youtube linux
https://www.youtube.com/feeds/videos.xml?channel_id=UCfbGTpcJyEOMwKP-eYz3_fg "~YT Rainer König" youtube emacs
https://www.youtube.com/feeds/videos.xml?channel_id=UCsnGwSIHyoYN0kiINAGUKxg "~YT Wolfgang's Channel" youtube linux
https://www.youtube.com/feeds/videos.xml?channel_id=UCQp2VLAOlvq142YN3JO3y8w "~YT John Kitchin" youtube emacs
https://www.youtube.com/feeds/videos.xml?channel_id=UCFk8kgNu_bqsRZewxMGqkzQ "~YT Emacs SF" youtube emacs
https://www.youtube.com/feeds/videos.xml?channel_id=UCIFJHWyIlN0XFrW2vMKG6QA "~YT Alain M. Lafon" youtube emacs
https://www.youtube.com/feeds/videos.xml?channel_id=UCvA_wgsX6eFAOXI8Rbg_WiQ "~YT tutoriaLinux" youtube linux
https://www.youtube.com/feeds/videos.xml?channel_id=UCUF4bHszxd8T4ulrvLejumA "~YT Alexander Fu" youtube emacs
https://www.youtube.com/feeds/videos.xml?channel_id=UCbW6-rTEn6nPj56K_9dLozQ "~YT Gilles Castel" youtube linux
https://www.youtube.com/feeds/videos.xml?channel_id=UCUR1pFG_3XoZn3JNKjulqZg "~YT thoughtbot" youtube linux emacs
https://www.youtube.com/feeds/videos.xml?channel_id=UCVls1GmFKf6WlTraIb_IaJg "~YT DistroTube" youtube linux
https://www.youtube.com/feeds/videos.xml?channel_id=UCDEtZ7AKmwS0_GNJog01D2g "~YT Uncle Dave" youtube emacs
https://www.youtube.com/feeds/videos.xml?channel_id=UCYnrHo7CDgKobmoJ3Borrnw "~YT Niklas Carlsson" youtube emacs
https://www.youtube.com/feeds/videos.xml?channel_id=UCljOhRB2a3sQgLCdK9CHQvQ "~YT Leafshade Software" youtube linux
https://www.youtube.com/feeds/videos.xml?channel_id=UCwRXb5dUK4cvsHbx-rGzSgw "~YT Derek Banas" youtube linux
https://www.youtube.com/feeds/videos.xml?channel_id=UCP2bshADPrVMoNrdJvZEQzw "~YT KeepItTechie" youtube linux
https://www.youtube.com/feeds/videos.xml?channel_id=UCVRJ6D343dX-x730MRP8tNw "~YT cocadmin" youtube linux
https://www.youtube.com/feeds/videos.xml?channel_id=UCxkMDXQ5qzYOgXPRnOBrp1w "~YT Mike Zamansky" youtube emacs
https://www.youtube.com/feeds/videos.xml?channel_id=UCgREucssIfY9e0Iy3yhse8w "~YT Conner McDaniel" youtube linux
https://www.youtube.com/feeds/videos.xml?channel_id=UCkRmQ_G_NbdbCQMpALg6UPg "~YT emacsrocks" youtube emacs
https://www.youtube.com/feeds/videos.xml?channel_id=UC0uTPqBCFIpZxlz_Lv1tk_g "~YT Protesilaos Stavrou" youtube emacs
https://www.youtube.com/feeds/videos.xml?channel_id=UCsJXkw_Ssp-1myJFm4_SMJA "~YT Seorenn" youtube emacs
https://www.youtube.com/feeds/videos.xml?channel_id=UCvrQyT2xhsxq2a4Xopf2JTA "~YT Zaeph" youtube emacs
https://www.youtube.com/feeds/videos.xml?channel_id=UCYnl1cugi7Lv1h8j6JNqNEg "~YT Dima Gerasimov" youtube emacs
https://www.youtube.com/feeds/videos.xml?channel_id=UCDKPGD9T00eS_l--D_DRTUQ "~YT Linuxtricks" youtube linux
https://www.youtube.com/feeds/videos.xml?channel_id=UCcCeYbIBGQPB1G12psAPMKw "~YT Spudlyo" youtube emacs
https://www.youtube.com/feeds/videos.xml?channel_id=UCS97tchJDq17Qms3cux8wcA "~YT Chrisatmachine" youtube linux
https://www.youtube.com/feeds/videos.xml?channel_id=UCwFpzG5MK5Shg_ncAhrgr9g "~YT Awesome Open Source" youtube linux
https://www.youtube.com/feeds/videos.xml?channel_id=UC7YOGHUfC1Tb6E4pudI9STA "~YT Mental Outlaw" youtube linux
#+end_src
*** 3D-Printing and DIY
#+begin_src conf
https://www.youtube.com/feeds/videos.xml?channel_id=UCGEBcDJ7QIY1LuEddDM9x9Q "~YT Oldies" youtube 3d-printing
https://www.youtube.com/feeds/videos.xml?channel_id=UCqdRx3JV3xRchi4_xwFJUTA "~YT 8FabLab" youtube diy
https://www.youtube.com/feeds/videos.xml?channel_id=UCCsdIja21VT7AKkbVI5y8bQ "~YT Alain Vaillancourt" youtube diy
https://www.youtube.com/feeds/videos.xml?channel_id=UCyi6pFP-lmaDD3Eb4dqsvdg "~YT ioduremetallique" youtube diy
https://www.youtube.com/feeds/videos.xml?channel_id=UCYI8olK-jH9Ubc2FaA2LgPw "~YT Egalistel" youtube 3d-printing
https://www.youtube.com/feeds/videos.xml?channel_id=UCSULDz1yaHLVQWHpm4g_GHA "~YT monsieur bidouille" youtube diy
https://www.youtube.com/feeds/videos.xml?channel_id=UC2UT8pPDlUvRbQXTVOf5Ocw "~YT Henri Hihacks" youtube diy
https://www.youtube.com/feeds/videos.xml?channel_id=UCLecVrux63S6aYiErxdiy4w "~YT BRUH Automation" youtube diy
https://www.youtube.com/feeds/videos.xml?channel_id=UCQfMyugsjrVUWU0v_ZxQs2Q "~YT Machine Tech Video Blog" youtube diy engineering
https://www.youtube.com/feeds/videos.xml?channel_id=UCjED9uS41ioeFuPfbR-OBlw "~YT Les Freres Poulain" youtube diy
https://www.youtube.com/feeds/videos.xml?channel_id=UCVSHXNNBitaPd5lYz48--yg "~YT Tech Ingredients" youtube diy
https://www.youtube.com/feeds/videos.xml?channel_id=UCPFChjpOgkUqckj3378jt5w "~YT Heliox" youtube 3d-printing
https://www.youtube.com/feeds/videos.xml?channel_id=UC9_nxvBohH1G2yR77XTdA2g "~YT Tommy Desrochers" youtube 3d-printing diy
https://www.youtube.com/feeds/videos.xml?channel_id=UC6mIxFTvXkWQVEHPsEdflzQ "~YT GreatScott" youtube diy
#+end_src
*** Interesting - General
#+begin_src conf
https://www.youtube.com/feeds/videos.xml?channel_id=UC5eOLQO5VUEFJukNg9cl5jg "~YT Histoire Brève" youtube interesting
https://www.youtube.com/feeds/videos.xml?channel_id=UCMFcMhePnH4onVHt2-ItPZw "~YT Hygiène Mentale" youtube interesting
https://www.youtube.com/feeds/videos.xml?channel_id=UC9BnGZLT4iPaJtDOXYwQuHQ "~YT Primum Non Nocere" youtube interesting
https://www.youtube.com/feeds/videos.xml?channel_id=UCP46_MXP_WG_auH88FnfS1A "~YT Nota Bene" youtube interesting
https://www.youtube.com/feeds/videos.xml?channel_id=UCUR03ZSZlEvCO6EWwv4jU2w "~YT Absol Vidéos" youtube interesting
https://www.youtube.com/feeds/videos.xml?channel_id=UCWty1tzwZW_ZNSp5GVGteaA "~YT La statistique expliquée à mon chat" youtube interesting
https://www.youtube.com/feeds/videos.xml?channel_id=UCLbgxBMMEo6mAYe87esxGmg "~YT horror humanum est" youtube interesting
https://www.youtube.com/feeds/videos.xml?channel_id=UCOuIgj0CYCXCvjWywjDbauw "~YT Chat Sceptique" youtube interesting
#+end_src
*** Science
#+begin_src conf
https://www.youtube.com/feeds/videos.xml?channel_id=UCwgqYNmYaij2_8hq_tOFyZw "~YT Aurelien Barrau" youtube science
https://www.youtube.com/feeds/videos.xml?channel_id=UCeR8BYZS7IHYjk_9Mh5JgkA "~YT Scilabus" youtube science
https://www.youtube.com/feeds/videos.xml?channel_id=UC1Ue7TuX3iH4y8-Qrjj-hyg "~YT J'm'énerve pas, j'explique" youtube science
https://www.youtube.com/feeds/videos.xml?channel_id=UCjsHDXUU3BjBCG7OaCbNDyQ "~YT Le Sense Of Wonder" youtube science
https://www.youtube.com/feeds/videos.xml?channel_id=UC4PasDd25MXqlXBogBw9CAg "~YT Mickaël Launay" youtube science
https://www.youtube.com/feeds/videos.xml?channel_id=UCsz9DiwPtgDvxJ-njWnieZw "~YT Passe-Science" youtube science
https://www.youtube.com/feeds/videos.xml?channel_id=UC_GlthPB9gzdxfkTTEIVxMA "~YT Incroyables Expériences" youtube science engineering
https://www.youtube.com/feeds/videos.xml?channel_id=UCxqAWLTk1CmBvZFPzeZMd9A "~YT Domain of Science" youtube science
https://www.youtube.com/feeds/videos.xml?channel_id=UCaNlbnghtwlsGF-KzAFThqA "~YT ScienceEtonnante" youtube science
https://www.youtube.com/feeds/videos.xml?channel_id=UCeQEKFH31vvD-InkTGSvCrA "~YT brusspup" youtube science
https://www.youtube.com/feeds/videos.xml?channel_id=UCHnyfMqiRRG1u-2MsSQLbXA "~YT Veritasium" youtube science
https://www.youtube.com/feeds/videos.xml?channel_id=UCH6ppHEvV3_WIXEwmhv9HEg "~YT Deus Ex Silicium" youtube engineering science
https://www.youtube.com/feeds/videos.xml?channel_id=UC2LZO6swZ9SLUEOks3WnsfA "~YT 2veritasium" youtube science
https://www.youtube.com/feeds/videos.xml?channel_id=UCvGag7MyHR8H9oRm9iL9Ifw "~YT Experimentboy" youtube science
https://www.youtube.com/feeds/videos.xml?channel_id=UC6107grRI4m0o2-emgoDnAA "~YT SmarterEveryDay" youtube science
https://www.youtube.com/feeds/videos.xml?channel_id=UCtqICqGbPSbTN09K1_7VZ3Q "~YT DirtyBiology" youtube science
https://www.youtube.com/feeds/videos.xml?channel_id=UC_ZChHhr5nDrUymz7qsRqRw "~YT Confér'ENS" youtube science
https://www.youtube.com/feeds/videos.xml?channel_id=UCNmLe68qKzdjuEpT_YTDFuA "~YT Etonnarium" youtube science
https://www.youtube.com/feeds/videos.xml?channel_id=UCCSN5zJTKjl6UKvPcLzLuiw "~YT Macroscopie" youtube science
https://www.youtube.com/feeds/videos.xml?channel_id=UC7DdEm33SyaTDtWYGO2CwdA "~YT Physics Girl" youtube science
#+end_src
*** Keyboard
#+begin_src conf
https://www.youtube.com/feeds/videos.xml?channel_id=UC5ClFK9Ko4ACRgXjRZc_GfA "~YT Rhinofeed" youtube keyboards
https://www.youtube.com/feeds/videos.xml?channel_id=UC2yitP8oH86YBRVU4anycoA "~YT Quentin Lebastard" youtube keyboards
#+end_src
*** Music
#+begin_src conf
https://www.youtube.com/feeds/videos.xml?channel_id=UC3gZqwD45zGCsduBn-Q2lew "~YT Gabrielle Grau" youtube music
https://www.youtube.com/feeds/videos.xml?channel_id=UCZHPwKyeypWwU8SNJSzQhCw "~YT Révisons nos Classiques" youtube music
https://www.youtube.com/feeds/videos.xml?channel_id=UCPpNtkHeCnwN7Tl5oLq4AAg "~YT Une chanson, l'addition" youtube music
https://www.youtube.com/feeds/videos.xml?channel_id=UC_17P1ruDpCVujf7C_SxhOA "~YT Metalliquoi" youtube music
https://www.youtube.com/feeds/videos.xml?channel_id=UCzabZYC0MYRR2MFkq62d6yQ "~YT Florent Garcia" youtube music
#+end_src
*** Space
#+begin_src conf
https://www.youtube.com/feeds/videos.xml?channel_id=UCdL3UpiseRlvxXuORJjmqZw "~YT Stardust" youtube space
https://www.youtube.com/feeds/videos.xml?channel_id=UC5X4e8ScZI2AFd_vkjSoyoQ "~YT AstronoGeek" youtube space
#+end_src
*** Engineering
#+begin_src conf
https://www.youtube.com/feeds/videos.xml?channel_id=UCotwjyJnb-4KW7bmsOoLfkg "~YT Art of the Problem" youtube engineering
https://www.youtube.com/feeds/videos.xml?channel_id=UCR1IuLEqb6UEA_zQ81kwXfg "~YT Real Engineering" youtube engineering
https://www.youtube.com/feeds/videos.xml?channel_id=UCfsznjef2zGJnrCRQBXqo6Q "~YT Machine Thinking" youtube engineering
https://www.youtube.com/feeds/videos.xml?channel_id=UC2bkHVIDjXS7sgrgjFtzOXQ "~YT engineerguy" youtube engineering
https://www.youtube.com/feeds/videos.xml?channel_id=UCivA7_KLKWo43tFcCkFvydw "~YT Applied Science" youtube science engineering
https://www.youtube.com/feeds/videos.xml?channel_id=UCk0fGHsCEzGig-rSzkfCjMw "~YT The Engineering Mindset" youtube engineering
https://www.youtube.com/feeds/videos.xml?channel_id=UC5_Y-BKzq1uW_2rexWkUzlA "~YT New Mind" youtube engineering
#+end_src
*** Random - Fun - Others
#+begin_src conf
https://www.youtube.com/feeds/videos.xml?channel_id=UCJM10Rp7G0h9j5S92QszJ5Q "~YT Tales From The Click" youtube random
https://www.youtube.com/feeds/videos.xml?channel_id=UCCMxHHciWRBBouzk-PGzmtQ "~YT Bazar du Grenier" youtube random
https://www.youtube.com/feeds/videos.xml?channel_id=UCTt2AnK--mnRmICnf-CCcrw "~YT Le Rire Jaune" youtube random
https://www.youtube.com/feeds/videos.xml?channel_id=UCJRljQ8OcyfzHBYpS_bDbow "~YT La Mezzanine" youtube random
https://www.youtube.com/feeds/videos.xml?channel_id=UCVTAmJvZOxuj9Kto8Ty9L8Q "~YT Rapha Gaming" youtube random
https://www.youtube.com/feeds/videos.xml?channel_id=UCTafEJoRl5myC8A50plIrng "~YT FabienOlicard" youtube random
https://www.youtube.com/feeds/videos.xml?channel_id=UCZeyUZmGAyRLDfM2ir3q-OQ "~YT Captain Popcorn" youtube random
https://www.youtube.com/feeds/videos.xml?channel_id=UCwzxu1j19ICnfW5zrBvUw-w "~YT Une bière et Jivay" youtube random
https://www.youtube.com/feeds/videos.xml?channel_id=UCPF7JOWMDWZmnP_cQfyAezg "~YT Scinéma" youtube random
https://www.youtube.com/feeds/videos.xml?channel_id=UCUK0HBIBWgM2c4vsPhkYY4w "~YT The Slow Mo Guys" youtube random
https://www.youtube.com/feeds/videos.xml?channel_id=UCxeA1l2E5AYrtpkqUbBEg3A "~YT Pierre Lecourt" youtube random
https://www.youtube.com/feeds/videos.xml?channel_id=UCYD22MFqaNqXp-ogTMosW_A "~YT Le Show Jaune" youtube random
https://www.youtube.com/feeds/videos.xml?channel_id=UC4HANn7TBY-xcION-eL3rLA "~YT Daniil le Russe" youtube random
https://www.youtube.com/feeds/videos.xml?channel_id=UCf0mOxfawezlHIVuHd3L2VA "~YT Didi Chandouidoui" youtube random
https://www.youtube.com/feeds/videos.xml?channel_id=UCw3tZ7g_FljNjzGprCuptpA "~YT Taupe10" youtube random
https://www.youtube.com/feeds/videos.xml?channel_id=UCfXXAQ-mp1uUcvSpvMcAAtw "~YT LinksTheSun" youtube random
https://www.youtube.com/feeds/videos.xml?channel_id=UCWeg2Pkate69NFdBeuRFTAw "~YT Squeezie" youtube random
https://www.youtube.com/feeds/videos.xml?channel_id=UCtI6_1vGanPlH5lgVIDjJGQ "~YT MrAntoineDaniel" youtube random
https://www.youtube.com/feeds/videos.xml?channel_id=UCm3C3OSgcyzaTBXrNRupB3Q "~YT Le Woop" youtube random
https://www.youtube.com/feeds/videos.xml?channel_id=UCuBzVunAVbcwzMfQaJVacuw "~YT LE ROI DES RATS" youtube random
https://www.youtube.com/feeds/videos.xml?channel_id=UCyWqModMQlbIo8274Wh_ZsQ "~YT Cyprien" youtube random
https://www.youtube.com/feeds/videos.xml?channel_id=UCAFQjCZo5okIPkHUQlBZM-g "~YT Bonjour Tristesse" youtube random
https://www.youtube.com/feeds/videos.xml?channel_id=UCoZoRz4-y6r87ptDp4Jk74g "~YT Palmashow" youtube random
https://www.youtube.com/feeds/videos.xml?channel_id=UCww2zZWg4Cf5xcRKG-ThmXQ "~YT NORMAN FAIT DES VIDÉOS" youtube random
https://www.youtube.com/feeds/videos.xml?channel_id=UCkEa1AfdeB93-he4VziKGFg "~YT JIGMÉ" youtube random
https://www.youtube.com/feeds/videos.xml?channel_id=UCND0gjuG9ltEWDvh82VJITg "~YT Jeannot Nymouce" youtube random
https://www.youtube.com/feeds/videos.xml?channel_id=UCP5tjEmvPItGyLhmjdwP7Ww "~YT RealLifeLore" youtube random
https://www.youtube.com/feeds/videos.xml?channel_id=UCwbV8cTR4yBgFdfa_BXV2OA "~YT Le Fossoyeur de Films" youtube random
https://www.youtube.com/feeds/videos.xml?channel_id=UCGgvKW19IWVvUUblrr8EgHA "~YT Experimentboy 2" youtube random
https://www.youtube.com/feeds/videos.xml?channel_id=UCJZ94qp4dtCw0Q5UQqAkg7w "~YT larsandersen23" youtube random
https://www.youtube.com/feeds/videos.xml?channel_id=UCDPK_MTu3uTUFJXRVcTJcEw "~YT Mcfly et Carlito" youtube random
https://www.youtube.com/feeds/videos.xml?channel_id=UC2_OG1L8DLTzQ7UrZVOk7OA "~YT Axolot" youtube random
#+end_src

View File

@@ -208,15 +208,6 @@ class = Dunst
startup_notification = false
#+end_src
* Shortcuts
#+BEGIN_SRC conf
[shortcuts]
# Available modifiers are "ctrl", "mod1" (the alt-key), "mod2",
# "mod3" and "mod4" (windows-key).
close = mod1+space
history = mod1+BackSpace
#+end_src
* Urgency
#+BEGIN_SRC conf
[urgency_low]

View File

@@ -1,42 +0,0 @@
#+TITLE: PCManFM
#+SETUPFILE: ./setup/org-setup-file.org
#+PROPERTY: header-args:bash :comments both
#+PROPERTY: header-args:bash+ :mkdirp yes
#+PROPERTY: header-args:bash+ :shebang "#!/bin/sh"
#+PROPERTY: header-args:bash+ :tangle ~/.config/pcmanfm/default/pcmanfm.conf
* Config
#+BEGIN_SRC conf
[config]
bm_open_method=0
#+END_SRC
* Volume
#+BEGIN_SRC conf
[volume]
mount_on_startup=0
mount_removable=0
autorun=0
#+END_SRC
* UI
#+BEGIN_SRC conf
[ui]
always_show_tabs=0
max_tab_chars=32
win_width=1263
win_height=690
splitter_pos=150
media_in_new_tab=0
desktop_folder_new_win=0
change_tab_on_drop=1
close_on_unmount=1
focus_previous=0
side_pane_mode=places
view_mode=icon
show_hidden=0
sort=mtime;descending;
toolbar=newtab;navigation;home;
show_statusbar=1
pathbar_mode_buttons=0
#+END_SRC

File diff suppressed because it is too large Load Diff

View File

@@ -23,7 +23,7 @@ config.load_autoconfig(True)
c.aliases = {'w': 'session-save', 'q': 'quit', 'wq': 'quit --save'}
c.auto_save.session = False
c.backend = 'webengine'
c.confirm_quit = ['downloads']
c.confirm_quit = ['downloads', 'multiple-tabs']
#+END_SRC
#+begin_src python
@@ -42,7 +42,6 @@ c.content.autoplay = False
c.content.notifications.enabled = False
c.content.geolocation = 'ask'
c.content.javascript.alert = True
c.content.javascript.can_access_clipboard = True
c.content.pdfjs = False
c.content.proxy = 'system'
c.content.blocking.method = 'both'
@@ -51,7 +50,7 @@ c.content.blocking.adblock.lists = ['https://easylist.to/easylist/easylist.txt',
* Editor
#+begin_src python
c.editor.command = ['/usr/bin/alacritty', '--class', 'terminal,Floating', '-e', 'nvim', '{}']
c.editor.command = ['kitty', '--class', 'terminal,Floating', '-e', 'nvim', '{}']
#+end_src
* Downloads
@@ -67,9 +66,9 @@ c.downloads.remove_finished = 10000
* File Select
#+begin_src python
c.fileselect.handler = "default"
# c.fileselect.single_file.command = ['termine', '-e', 'ranger', '--choosefile', '{}']
# c.fileselect.multiple_files.command = ['alacritty', '-e', 'ranger', '--choosefiles', '{}']
c.fileselect.handler = "external"
c.fileselect.single_file.command = ['kitty', '--class', 'floating', '-e', 'yazi', '--chooser-file', '{}']
c.fileselect.multiple_files.command = ['kitty', '--class', 'floating', '-e', 'yazi', '--chooser-file', '{}']
#+end_src
* Colors
@@ -180,15 +179,15 @@ c.url.searchengines = {
'sm': 'https://www.openstreetmap.org/search?query={}',
'am': 'https://www.amazon.fr/s?k={}',
'md': 'https://fr.mathworks.com/help/search.html?qdoc={}&submitsearch=',
'tf': 'https://translate.google.com/#view=home&op=translate&sl=en&tl=fr&text={}',
'te': 'https://translate.google.com/#view=home&op=translate&sl=fr&tl=en&text={}',
'tf': 'https://www.deepl.com/en/translator#en/fr/{}',
'te': 'https://www.deepl.com/en/translator#fr/en/{}',
'lb': 'https://www.leboncoin.fr/recherche?text={}',
}
#+end_src
#+begin_src python
c.url.start_pages = ['https://homer.tdehaeze.xyz/']
c.url.default_page = 'https://homer.tdehaeze.xyz/'
c.url.start_pages = ['https://homepage.tdehaeze.xyz/']
c.url.default_page = 'https://homepage.tdehaeze.xyz/'
#+END_SRC
* Normal Bindings
@@ -234,8 +233,8 @@ config.bind('m', 'quickmark-save')
Open New Pages/Tabs
#+begin_src python
config.bind('o', 'set-cmd-text -s :open')
config.bind('O', 'set-cmd-text -s :open -t')
config.bind('o', 'cmd-set-text -s :open')
config.bind('O', 'cmd-set-text -s :open -t')
#+end_src
Open new page/tab with clipboard content
@@ -260,10 +259,11 @@ Go to specific websites
config.bind('gy', 'open -t https://www.youtube.com/feed/subscriptions')
config.bind('gf', 'open -t https://rss.tdehaeze.xyz/')
config.bind('gr', 'open -t https://www.reddit.com/')
config.bind('gh', 'open -t https://homer.tdehaeze.xyz/')
config.bind('gh', 'open -t https://homepage.tdehaeze.xyz/')
config.bind('ge', 'open -t http://intranet.esrf.fr/')
config.bind('gc', 'open -t https://calendar.esrf.fr/')
config.bind('gn', 'open -t https://node-red.tdehaeze.xyz/ui/#!/1')
config.bind('gN', 'open -t https://node-red.pic05.eu/ui/#!/3')
config.bind('gb', 'open -t qute://bookmarks')
config.bind('gH', 'open -t qute://history')
@@ -276,11 +276,6 @@ config.bind('D', 'close')
#+end_src
* Custom Bindings
Create a Password for the current website
#+begin_src python
c.aliases['Password_Add'] = 'spawn --userscript ~/.config/qutebrowser/userscripts/add-passowrd.sh'
config.bind(',P', 'Password_Add')
#+end_src
#+begin_src python
c.aliases['proxy_homelab_on'] = 'set content.proxy socks5://localhost:8080'
@@ -298,12 +293,36 @@ c.aliases['Password_Fill'] = 'spawn --userscript password_fill'
config.bind(',p', 'Password_Fill')
#+END_SRC
Create a Password for the current website
#+begin_src python
c.aliases['Password_Add'] = 'spawn --userscript ~/.config/qutebrowser/userscripts/add-passowrd.sh'
config.bind(',P', 'Password_Add')
#+end_src
#+begin_src python
c.aliases['Password_ESRF'] = 'spawn --userscript password_ESRF'
config.bind(',e', 'Password_ESRF')
#+end_src
#+begin_src python
c.aliases['OTP_ESRF'] = 'spawn --userscript OTP_ESRF'
config.bind(',3', 'OTP_ESRF')
#+end_src
#+RESULTS:
Get Two Factor Authentication number.
#+begin_src python
c.aliases['OTP'] = 'spawn --userscript ~/.config/qutebrowser/userscripts/get-otp.sh'
config.bind(',2', 'OTP')
#+END_SRC
Open current page with Firefox:
#+begin_src python
c.aliases['Firefox'] = 'spawn --detach firefox-developer-edition --new-tab {url}'
config.bind(',f', 'Firefox')
#+END_SRC
Open Youtube video using =mpv=
#+begin_src python
c.aliases['MPV_view'] = 'spawn --detach mpv --force-window yes {url}'
@@ -370,12 +389,6 @@ c.aliases['Download_AES'] = 'spawn --userscript aes-download.sh'
config.bind(',E', 'Download_AES')
#+end_src
Download a torrent
#+begin_src python
c.aliases['Download_Torrent_Homelab'] = 'hint links spawn torrent-add {hint-url}'
config.bind(',t', 'Download_Torrent_Homelab')
#+end_src
See Amazon price history using CamelCamelCamel
#+begin_src python
c.aliases['CamelCamelCamel'] = 'open -t https://fr.camelcamelcamel.com/search?sq={url}'
@@ -406,17 +419,17 @@ config.bind(',q', 'QRcode')
** Create a new password
#+begin_src bash :tangle ~/.config/qutebrowser/userscripts/add-passowrd.sh
url=$(echo "$QUTE_URL" | awk -F[/:] '{print $4}' | rofi -p "URL" -dmenu -lines 1)
url=$(echo "$QUTE_URL" | awk -F[/:] '{print $4}' | rofi -i -p "URL" -dmenu -lines 1)
username=$(echo -e "dehaeze.thomas@gmail.com\nthomas.dehaeze@esrf.fr\ntdehaeze" | rofi -p "Username" -dmenu -lines 5)
password=$(rofi -p "Password" -dmenu -password -lines 1)
if [ -z "$url" ] || [ -z "$username" ] || [ -z "$password" ]; then
notify-send --hint=string:x-dunst-stack-tag:0vRM5AMP --urgency=critical "Pass" "Failed to Add Password"
dunstify --urgency=critical "Pass" "Failed to Add Password"
else
echo -e "$password\nlogin: $username\nurl: $QUTE_URL" > /tmp/add-password.txt
pass insert --multiline "$url/$username" < /tmp/add-password.txt;
rm /tmp/add-password.txt
notify-send --hint=string:x-dunst-stack-tag:0vRM5AMP "Pass " "Password Added"
dunstify "Pass " "Password Added"
fi
#+end_src
@@ -429,15 +442,15 @@ if [[ "$1" == *"list"* ]]; then
fi
if [ -n "$choice" ] && [ "$choice" = "Playlist" ]; then
notify-send --hint=string:x-dunst-stack-tag:iOGRwrDG "Youtube " "Downloading Playlist...";
dunstify --replace=19243 "Youtube " "Downloading Playlist...";
youtube-dl -i -f 'bestvideo[height<=720]+bestaudio/best[height<=720]' "$1" -o "%(playlist_title)s/%(playlist_index)s-%(title)s.%(ext)s" && \
notify-send --hint=string:x-dunst-stack-tag:iOGRwrDG "Youtube " "Downloaded" || \
notify-send --hint=string:x-dunst-stack-tag:iOGRwrDG --urgency=critical "Youtube " "Failed to download"
dunstify --replace=19243 "Youtube " "Downloaded" || \
dunstify --replace=19243 --urgency=critical "Youtube " "Failed to download"
else
notify-send --hint=string:x-dunst-stack-tag:iOGRwrDG "Youtube " "Downloading Video...";
dunstify --replace=19243 "Youtube " "Downloading Video...";
youtube-dl --no-playlist -f 'bestvideo[height<=720]+bestaudio/best[height<=720]' "$1" && \
notify-send --hint=string:x-dunst-stack-tag:iOGRwrDG "Youtube " "Downloaded" || \
notify-send --hint=string:x-dunst-stack-tag:iOGRwrDG --urgency=critical "Youtube " "Failed to download"
dunstify --replace=19243 "Youtube " "Downloaded" || \
dunstify --replace=19243 --urgency=critical "Youtube " "Failed to download"
fi
#+end_src
@@ -464,6 +477,16 @@ choose_entry() {
}
#+end_src
** Password_fill_ESRF
#+begin_src bash :tangle ~/.config/qutebrowser/userscripts/password_ESRF
echo "insert-text $(pass esrf.fr/dehaeze | head -n 1) ;; cmd-later 100 fake-key <enter>" >> "$QUTE_FIFO"
#+end_src
** OTP_fill_ESRF
#+begin_src bash :tangle ~/.config/qutebrowser/userscripts/OTP_ESRF
echo "insert-text $(pass otp totp-esrf) ;; cmd-later 100 fake-key <enter>" >> "$QUTE_FIFO"
#+end_src
** Org-Capture
#+begin_src bash :tangle ~/.config/qutebrowser/userscripts/org-capture.sh
readonly CAPTURE_SCRIPT=~/.config/qutebrowser/userscripts/org-protocol-capture-html.sh
@@ -620,7 +643,7 @@ if [[ -z "${LINKDING_TOKEN}" ]]; then
LINKDING_TOKEN=$(pass nas/linkding_token)
fi
curl -H "Authorization: Token ${LINKDING_TOKEN}" ${LINKDING_URL}/api/bookmarks/ | jq '.results[] | "\(.title) - \(.url) - [#\((.tag_names | join(", #")))]"' -r | rofi -dmenu -no-custom | grep -Eo 'https?://[^ ]+' | head -1 | xargs -I {} echo "open -t {}" >> "$QUTE_FIFO"
curl -H "Authorization: Token ${LINKDING_TOKEN}" ${LINKDING_URL}/api/bookmarks/ | jq '.results[] | "\(.title) - \(.url) - [#\((.tag_names | join(", #")))]"' -r | rofi -dmenu -i -no-custom | grep -Eo 'https?://[^ ]+' | head -1 | xargs -I {} echo "open -t {}" >> "$QUTE_FIFO"
#+end_src
** Add Url to Linkding
@@ -641,8 +664,8 @@ new_tags=$(rofi -p "New tags" -dmenu)
formated_tags=$(echo $existing_tags $new_tags | sed -E 's/(\w+)/"\1"/g;s/\s/,/g')
curl -H "Authorization: Token ${LINKDING_TOKEN}" -H "Content-Type: application/json" -d "{\"url\": \"$QUTE_URL\", \"title\": \"$title\", \"tag_names\": [$formated_tags]}" ${LINKDING_URL}/api/bookmarks/ && \
notify-send --hint=string:x-dunst-stack-tag:l3gV75RD "Linkding" " Bookmark Added" || \
notify-send --hint=string:x-dunst-stack-tag:l3gV75RD --urgency=critical "Linkding" "Failed"
dunstify "Linkding" " Bookmark Added" || \
dunstify --urgency=critical "Linkding" "Failed"
#+end_src
** Add Url to Buku using Rofi
@@ -651,28 +674,28 @@ title=$(echo "$QUTE_TITLE" | rofi -p "Title" -dmenu -lines 1)
tags=$(buku -t --nc --np | sed -e 's/\s*[[:digit:]]*\.\s*\(.*\)\s*([[:digit:]]*)\s*/\1/' -e '/^\s*$/d' | sort | uniq | rofi -multi-select -p "Tags" -dmenu | tr "\n" "," | sed 's/\s*,\s*$//')
buku --add "$QUTE_URL" --tag "$tags" --title "$title" && \
notify-send --hint=string:x-dunst-stack-tag:E3TueNZ0 "Buku" "Bookmark Added" || \
notify-send --hint=string:x-dunst-stack-tag:E3TueNZ0 --urgency=critical "Buku" " Bookmark Added"
dunstify "Buku" "Bookmark Added" || \
dunstify --urgency=critical "Buku" " Bookmark Added"
#+end_src
** Add Url to Buku without asking for information
#+begin_src bash :tangle ~/.config/qutebrowser/userscripts/buku-add.sh
buku --add $QUTE_URL --title "$QUTE_TITLE" && \
notify-send "Buku" "📑 Bookmark Added"
dunstify "Buku" "📑 Bookmark Added"
#+end_src
** Download with aria2c
#+begin_src bash :tangle ~/.config/qutebrowser/userscripts/aria2c-add.sh
aria2p add "$1" && \
notify-send --hint=string:x-dunst-stack-tag:2SGClDoI "Aria2" "Download Started" || \
notify-send --hint=string:x-dunst-stack-tag:2SGClDoI "Aria2" "Error"
dunstify "Aria2" "Download Started" || \
dunstify "Aria2" "Error"
#+end_src
** Download with aria2c on the Homelab
#+begin_src bash :tangle ~/.config/qutebrowser/userscripts/aria2c-add-homelab.sh
dl-add $(echo "$1" | sed 's/\&af=.*$//g') && \
notify-send --hint=string:x-dunst-stack-tag:2SGClDoI "Aria2" "Download Started" || \
notify-send --hint=string:x-dunst-stack-tag:2SGClDoI "Aria2" "Error"
dunstify "Aria2" "Download Started" || \
dunstify "Aria2" "Error"
#+end_src
** Save to PNG
@@ -680,19 +703,20 @@ dl-add $(echo "$1" | sed 's/\&af=.*$//g') && \
filename=$(rofi -p "filename" -dmenu -lines 1)
if [ -n "filename" ]; then
cd ~/Pictures/ && \
firefox -P default -headless --screenshot "$filename.png" "$QUTE_URL" && \
notify-send "Screenshot" "Taken successfully"
cd ~/Cloud/pictures/screenshots/ && \
firefox-developer-edition -P default -headless --screenshot "$filename.png" "$QUTE_URL" && \
dunstify "Screenshot" "Taken successfully"
fi
#+end_src
** Get OTP number
#+begin_src bash :tangle ~/.config/qutebrowser/userscripts/get-otp.sh
passname=$(ls ~/.password-store/totp-* | xargs -n 1 basename | sed -e 's/\..*$//' | rofi -p "TOPT" -dmenu)
passname=$(ls ~/.local/share/pass/totp-* | xargs -n 1 basename | sed -e 's/\..*$//' | rofi -p "TOPT" -dmenu)
if [ -n "$passname" ]; then
pass otp $passname | xsel -ib && \
notify-send 'OTP' 'copied to clipboard.' &
otpnumber=`pass otp $passname`
echo $otpnumber | xsel -ib
dunstify 'OTP' "$otpnumber" &
fi
#+end_src
@@ -701,16 +725,444 @@ fi
m3u8_path=`curl -L -s "$QUTE_URL" | pcregrep -o1 "file = \"\/(.*aes.*mp4)\""`
if [ -z "$m3u8_path" ]; then
notify-send --hint=string:x-dunst-stack-tag:ng4iXDxP --urgency=critical "Qutebrowser" "No m3u8 playlist found"
dunstify --urgency=critical "Qutebrowser" "No m3u8 playlist found"
else
notify-send --hint=string:x-dunst-stack-tag:ng4iXDxP "Qutebrowser" "Downloads..." && \
dunstify "Qutebrowser" "Downloads..." && \
cd ~/Downloads/ && \
ffmpeg -user_agent "Mozilla/5.0 (X11; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0" -referer "$QUTE_URL" -i "https://cdn2.digitellinc.com/play/_definst_/mp4:$m3u8_path/playlist.m3u8" -c copy "$QUTE_TITLE.mp4" && \
notify-send --hint=string:x-dunst-stack-tag:ng4iXDxP "Qutebrowser" "$QUTE_TITLE Downloaded"
dunstify "Qutebrowser" "$QUTE_TITLE Downloaded"
fi
#+end_src
** Display URL as a QRcode
#+begin_src bash :tangle ~/.config/qutebrowser/userscripts/url-to-qrcode.sh
qrencode -o /tmp/qrcode.png "$1" && sxiv /tmp/qrcode.png
qrencode -o /tmp/qrcode.png "$1" && nsxiv /tmp/qrcode.png
#+end_src
* Greasemonkey Scripts
** Skip Youtube ads
https://github.com/qutebrowser/qutebrowser/issues/6480
https://greasyfork.org/en
#+begin_src javascript :tangle ~/.local/share/qutebrowser/greasemonkey/youtube-adblock.user.js
// ==UserScript==
// @name Disable YouTube Video Ads
// @namespace DisableYouTubeVideoAds
// @version 1.5.42
// @license AGPLv3
// @author jcunews
// @description Disable YouTube video & screen based ads at home page, and right before or in the middle of the main video playback. Also disable YouTube's anti-adblocker popup dialog. For new YouTube layout (Polymer) only.
// @website https://greasyfork.org/en/users/85671-jcunews
// @include https://www.youtube.com/*
// @grant unsafeWindow
// @run-at document-start
// ==/UserScript==
((window, disableAnnotations, fn) => {
//===== CONFIG BEGIN =====
disableAnnotations = true;
//===== CONFIG END =====
fn = (a, ipse, haia, hca, rpo, et) => {
if ((a = document.scripts[document.scripts.length - 1]) && (a.id === "dyvaUjs")) a.remove();
et = document.styleSheetSetsz ? "beforescriptexecute" : false; //Firefox workaround
JSON.parse_dyva = JSON.parse;
JSON.parse = function(a) {
var m, z;
if (rpo) {
a = rpo; //JSON.parse_dyva(a); //from xhr/fetch
try {
if (a.forEach) {
a.forEach((p, a) => {
if (p.player && p.player.args && (p.player.args.raw_player_response || p.player.args.player_response)) {
patchPlayerResponse(a = p.player_response_);
if (p.player.args.raw_player_response) {
p.raw_player_response = JSON.stringify(a)
} else p.player_response = JSON.stringify(a)
} else if (p.playerResponse) {
patchPlayerResponse(p.playerResponse);
}
});
} else patchPlayerResponse(a);
} catch(z) {}
rpo = null;
} else if ((a = JSON.parse_dyva(a)).playerResponse) patchPlayerResponse(a.playerResponse);
return a;
};
var ftc = window.fetch_dyva = window.fetch;
window.fetch = function(u) {
if (u) {
if (u.substr && /\/v1\/player\/ad_break/.test(u)) return new Promise(() => {});
if (u.url && u.url.substr && /\/v1\/player\/ad_break/.test(u.url)) return new Promise(() => {});
}
return ftc.apply(this, arguments);
};
var rj = Response.prototype.json_dyva = Response.prototype.json;
Response.prototype.json = function() {
var rs = this, p = rj.apply(this, arguments), pt = p.then;
p.then = function(fn) {
var fn_ = fn;
fn = function(j) {
if (/\/v1\/player\?/.test(rs.url)) rpo = j;
if ("function" === typeof fn_) return fn_.apply(this, arguments);
};
return pt.apply(this, arguments);
};
return p;
};
var rt = Response.prototype.text;
Response.prototype.text = function() {
var rs = this, p = rt.apply(this, arguments), pt = p.then;
p.then = function(fn) {
var fn_ = fn;
fn = function(t) {
if (/\/v1\/player\?/.test(rs.url)) rpo = JSON.parse_dyva(t);
if ("function" === typeof fn_) return fn_.apply(this, arguments);
};
return pt.apply(this, arguments);
};
return p;
};
window.XMLHttpRequest.prototype.open_dyva = window.XMLHttpRequest.prototype.open;
window.XMLHttpRequest.prototype.open = function(mtd, url) {
if (!(/get_midroll_info/).test(url) && !((/^\/watch/).test(location.pathname) && (/get_video_info/).test(url))) {
this.url_dyva = url;
return this.open_dyva.apply(this, arguments);
}
};
window.XMLHttpRequest.prototype.addEventListener_dyva = window.XMLHttpRequest.prototype.addEventListener;
window.XMLHttpRequest.prototype.addEventListener = function(typ, fn) {
if (typ === "readystatechange") {
var f = fn;
fn = function() {
var z;
if (this.readyState === 4) {
if (this.url_dyva?.includes("youtubei/v1/player")) {
rpo = JSON.parse_dyva(this.responseText);
try {
patchPlayerResponse(rpo);
} catch(z) {}
} else if ((/\/watch\?|get_video_info/).test(this.url_dyva)) {
rpo = JSON.parse_dyva(this.responseText);
try {
rpo.forEach(p => {
if (p.player && p.player.args && (p.player.args.raw_player_response || p.player.args.player_response)) {
p.playerResponse_ = JSON.parse_dyva(p.player.args.raw_player_response || p.player.args.player_response);
if (p.playerResponse_.playabilityStatus && (p.playerResponse_.playabilityStatus.status === "LOGIN_REQUIRED")) {
nav.navigate({commandMetadata: {webCommandMetadata: {url: location.href, webPageType: "WEB_PAGE_TYPE_BROWSE"}}}, false);
return;
}
patchPlayerResponse(p.playerResponse_);
if (p.player.args.raw_player_response) {
p.player.args.raw_player_response = JSON.stringify(p.playerResponse_)
} else p.player.args.player_response = JSON.stringify(p.playerResponse_)
} else if (p.playerResponse) {
patchPlayerResponse(p.playerResponse);
}
});
} catch(z) {}
}
}
return f.apply(this, arguments);
};
}
return this.addEventListener_dyva.apply(this, arguments);
};
window.Node.prototype.appendChild_dyva = window.Node.prototype.appendChild;
window.Node.prototype.appendChild = function(node) {
var a;
if (!ipse && (a = document.querySelector('ytd-watch-flexy')) && (a = a.constructor.prototype) && a.isPlaShelfEnabled_) {
a.isPlaShelfEnabled_ = () => false;
ipse = true;
}
if ((!hca || !haia) && (a = document.querySelector('ytd-watch-next-secondary-results-renderer')) && (a = a.constructor.prototype)) {
if (a.hasAllowedInstreamAd_ && !haia) {
a.hasAllowedInstreamAd_ = () => false;
haia = true;
}
if (a.hasCompanionAds_ && !hca) {
a.hasCompanionAds_ = () => false;
hca = true;
}
}
if ((node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) && Array.from(node.childNodes).some((n, i) => {
if (n.id === "masthead-ad") {
n.style.setProperty("display", "none", "important");
//n.remove();
return true;
}
})); //window.Node.prototype.appendChild = window.Node.prototype.appendChild_dyva;
if (node.querySelector && (a = node.querySelector('.ytp-ad-skip-button'))) a.click();
return this.appendChild_dyva.apply(this, arguments);
};
var to = {createHTML: s => s, createScript: s => s}, tp = window.trustedTypes?.createPolicy ? trustedTypes.createPolicy("", to) : to;
var html = s => tp.createHTML(s), script = s => tp.createScript(s);
function patchPlayerResponse(playerResponse, i) {
delete playerResponse.adBreakHeartbeatParams;
if (playerResponse.adPlacements) playerResponse.adPlacements = [];
if (disableAnnotations) delete playerResponse.annotations;
if (playerResponse.adSlots) playerResponse.adSlots = [];
if (playerResponse.auxiliaryUi?.messageRenderers?.bkaEnforcementMessageViewModel) {
delete playerResponse.auxiliaryUi.messageRenderers.bkaEnforcementMessageViewModel;
if (!Object.keys(playerResponse.auxiliaryUi.messageRenderers).length) {
delete playerResponse.auxiliaryUi.messageRenderers;
if (!Object.keys(playerResponse.auxiliaryUi).length) delete playerResponse.auxiliaryUi
}
var vd = playerResponse.videoDetails;
delete playerResponse.videoDetails;
Object.defineProperty(playerResponse, "videoDetails", {
get() {
return vd
},
set(v) {
if (this.playabilityStatus?.errorScreen) {
delete this.playabilityStatus.errorScreen;
this.playabilityStatus.status = "OK"
}
return v
}
});
}
if (playerResponse.messages) {
for (i = playerResponse.messages.length - 1; i >= 0; i--) {
if (playerResponse.messages[i].mealbarPromoRenderer) playerResponse.messages.splice(i, 1)
}
}
if (playerResponse.playerAds) playerResponse.playerAds = [];
if (playerResponse.playbackTracking) {
delete playerResponse.playbackTracking.googleRemarketingUrl;
delete playerResponse.playbackTracking.youtubeRemarketingUrl;
}
}
function patchPlayerArgs(args, a) {
if (args.ad_device) args.ad_device = "0";
if (args.ad_flags) args.ad_flags = 0;
if (args.ad_logging_flag) args.ad_logging_flag = "0";
if (args.ad_preroll) args.ad_preroll = "0";
if (args.ad_slots) delete args.ad_slots;
if (args.ad_tag) delete args.ad_tag;
if (args.ad3_module) args.ad3_module = "0";
if (args.adsense_video_doc_id) delete args.adsense_video_doc_id;
if (args.afv) args.afv = false;
if (args.afv_ad_tag) delete args.afv_ad_tag;
if (args.allow_html5_ads) args.allow_html5_ads = 0;
if (args.csi_page_type) args.csi_page_type = args.csi_page_type.replace(/watch7ad/, "watch7");
if (args.enable_csi) args.enable_csi = "0";
if (args.pyv_ad_channel) delete args.pyv_ad_channel;
if (args.show_pyv_in_related) args.show_pyv_in_related = false;
if (args.vmap) delete args.vmap;
if (args.raw_player_response) {
patchPlayerResponse(a = args.raw_player_response.charAt ? JSON.parse_dyva(args.raw_player_response) : args.raw_player_response);
if (args.raw_player_response.charAt) args.raw_player_response = JSON.stringify(a)
} else if (args.player_response) {
patchPlayerResponse(a = JSON.parse_dyva(args.player_response));
args.player_response = JSON.stringify(a);
}
}
function patchSpf() {
if (window.spf && !spf.request_dyva) {
spf.request_dyva = spf.request;
spf.request = function(a, b) {
if (b && b.onDone) {
var onDone_ = b.onDone;
b.onDone = function(response) {
var a = response;
if (a && (/\/watch\?/).test(a.url) && (a = a.response) && (a = a.parts)) {
a.forEach((p, a) => {
if (p.player && p.player.args && (p.player.args.raw_player_response || p.player.args.player_response)) {
p = p.player.args;
patchPlayerResponse(a = JSON.parse_dyva(p.raw_player_response || p.player_response));
if (p.raw_player_response) {
p.raw_player_response = JSON.stringify(a)
} else p.player_response = JSON.stringify(a)
} else if (p.playerResponse) {
patchPlayerResponse(p.playerResponse);
}
});
}
return onDone_.apply(this, arguments);
};
}
return this.request_dyva.apply(this, arguments);
};
return;
}
}
var ldh, docnt = 5 * 60;
function do1(ev, a) {
if ((a = document.scripts[document.scripts.length - 1]) && /"adPlacements"/.test(a.text)) {
a.text = script(a.text.replace(/"adPlacements"/, '"adPlacements":[],"zadPlacements"'));
}
if (window.loadDataHook) {
if (!window.loadDataHook.dyva) {
ldh = window.loadDataHook;
window.loadDataHook = function(ep, dt) {
if (dt.playabilityStatus && (dt.playabilityStatus === "LOGIN_REQUIRED")) {
location.href = location.href;
throw "Ain't gonna login";
}
patchPlayerResponse(dt);
return ldh.apply(this, arguments);
};
window.loadDataHook.dyva = true;
}
}
if (window.ytcfg && window.ytcfg.set) {
if (!window.ytcfg.set.dyva) {
var ytcfgSet = window.ytcfg.set;
window.ytcfg.set = function(ytConfig, ytValue){
if (window.ytInitialPlayerResponse) {
if (ytInitialPlayerResponse.playabilityStatus && (ytInitialPlayerResponse.playabilityStatus === "LOGIN_REQUIRED")) {
location.href = location.href;
throw "Ain't gonna login";
}
patchPlayerResponse(window.ytInitialPlayerResponse);
}
patchSpf();
if (ytConfig) {
var a;
if (a = ytConfig.EXPERIMENT_FLAGS) {
if (a.enable_auto_play_param_fix_for_masthead_ad) a.enable_auto_play_param_fix_for_masthead_ad = false;
if (a.html5_check_both_ad_active_and_ad_info) a.html5_check_both_ad_active_and_ad_info = false;
if (a.web_enable_ad_signals_in_it_context) a.web_enable_ad_signals_in_it_context = false;
}
if (ytConfig.SKIP_RELATED_ADS === false) ytConfig.SKIP_RELATED_ADS = true;
if (ytConfig.TIMING_ACTION) ytConfig.TIMING_ACTION = ytConfig.TIMING_ACTION.replace(/watch7ad/, "watch7");
if (a = ytConfig.TIMING_INFO) {
if (a.yt_ad) a.yt_ad = 0;
if (a.yt_ad_an) delete a.yt_ad_an;
if (a.yt_ad_pr) a.yt_ad_pr = 0;
}
if (
(a = ytConfig.WEB_PLAYER_CONTEXT_CONFIGS) && (a = a.WEB_PLAYER_CONTEXT_CONFIG_ID_KEVLAR_WATCH) &&
a.serializedExperimentFlags && a.serializedExperimentFlags.replace
) {
a.serializedExperimentFlags = a.serializedExperimentFlags.replace(
/([a-z][^=]+)=([^&]+)/g, (s, a, b) => {
switch (a) {
case "enable_ad_break_end_time_on_pacf_tvhtml5":
case "enable_auto_play_param_fix_for_masthead_ad":
case "html5_check_both_ad_active_and_ad_info": b = false; break;
case "web_enable_ad_signals_in_it_context":
case "web_player_gvi_wexit_adunit": b = false; break;
}
return a + "=" + b;
}
);
}
}
return ytcfgSet.apply(this, arguments);
};
window.ytcfg.set.dyva = true;
}
}
if (window.yt) {
if (window.yt.player && window.yt.player.Application) {
if (window.yt.player.Application.create) {
if (!window.yt.player.Application.create.dyva) {
var ytPlayerApplicationCreate = window.yt.player.Application.create;
window.yt.player.Application.create = function(id, ytPlayerConfig) {
if ((id === "player-api") && ytPlayerConfig && ytPlayerConfig.args) {
if (ytPlayerConfig.args.raw_player_response) patchPlayerResponse(ytPlayerConfig.args.raw_player_response);
if (ytPlayerConfig.args.vmap) delete ytPlayerConfig.args.vmap;
}
return ytPlayerApplicationCreate.apply(this, arguments);
};
window.yt.player.Application.create.dyva = true;
}
}
if (window.yt.player.Application.createAlternate) {
if (!window.yt.player.Application.createAlternate.dyva) {
var ytPlayerApplicationCreateAlternate = window.yt.player.Application.createAlternate;
window.yt.player.Application.createAlternate = function(id, ytPlayerConfig) {
if ((id === "player-api") && ytPlayerConfig && ytPlayerConfig.args) {
if (ytPlayerConfig.args.raw_player_response) patchPlayerResponse(ytPlayerConfig.args.raw_player_response);
if (ytPlayerConfig.args.vmap) delete ytPlayerConfig.args.vmap;
}
return ytPlayerApplicationCreateAlternate.apply(this, arguments);
};
window.yt.player.Application.createAlternate.dyva = true;
}
}
}
if (window.yt.setConfig) {
if (!window.yt.setConfig.dyva) {
var ytSetConfig = window.yt.setConfig;
window.yt.setConfig = function(ytConfig){
if (ytConfig && ytConfig.ADS_DATA) delete ytConfig.ADS_DATA;
return ytSetConfig.apply(this, arguments);
};
window.yt.setConfig.dyva = true;
}
}
}
if (window.ytplayer && window.ytplayer.config && window.ytplayer.config.args) {
if (!window.ytplayer.config.args.dvya) {
patchPlayerArgs(window.ytplayer.config.args);
window.ytplayer.config.args.dvya = true;
}
}
if (document.readyState !== "complete") {
if ((et === false) && (--docnt > 0)) requestAnimationFrame(do1)
} else if (et !== false) removeEventListener(et, do1)
}
addEventListener(et, do1);
do1();
addEventListener("spfpartprocess", function(ev) { //old youtube
if (ev.detail && ev.detail.part && ev.detail.part.data &&
ev.detail.part.data.swfcfg && ev.detail.part.data.swfcfg.args) {
patchPlayerArgs(ev.detail.part.data.swfcfg.args);
}
}, true);
addEventListener("load", a => {
if (!(a = window.ayvp_cssOverride)) {
a = document.createElement("STYLE");
a.id = "ayvp_cssOverride";
a.innerHTML = html(`\
.html5-video-player>.ytp-suggested-action,
.video-ads{display:none!important}
.ytp-ad-overlay-open .caption-window.ytp-caption-window-bottom{margin-bottom:4em}
.ytp-autohide .caption-window.ytp-caption-window-bottom, .ytp-hide-controls .caption-window.ytp-caption-window-bottom{margin-bottom:0!important}`);
document.documentElement.appendChild(a);
}
if (et === "message") {
if (document.readyState !== "complete") {
postMessage({});
} else removeEventListener(et, do1);
}
});
var dce = document.createElement;
document.createElement = function(tag) {
if ((tag === "meta") && window.ytInitialPlayerResponse && ytInitialPlayerResponse.adPlacements && ytInitialPlayerResponse.adPlacements.length) {
patchPlayerResponse(window.ytInitialPlayerResponse)
}
return dce.apply(this, arguments)
};
};
if (("object" === typeof GM_info) && ["FireMonkey", "Greasemonkey"].includes(GM_info.scriptHandler)) {
//FireMonkey and new Greasemonkey workaround for compatibility with the original (unrestricted) Greasemonkey version.
let e = document.createElement("SCRIPT");
e.id = "dyvaUjs";
e.text = "(" + fn + ")()";
document.documentElement.appendChild(e);
} else fn();
})(unsafeWindow);
#+end_src

View File

@@ -18,6 +18,16 @@ ranger --copy-config=scope
To add =scope.sh=.
The following has been added to preview =xournalpp= file:
#+begin_src bash
case "${FILE_EXTENSION_LOWER}" in
## xournall file
xopp)
xournalpp-thumbnailer "${FILE_PATH}" "${IMAGE_CACHE_PATH}" && exit 6
;;
esac
#+end_src
To have image preview:
#+begin_src bash :tangle no
sudo pip3 install ueberzug
@@ -41,7 +51,7 @@ set viewmode miller
set column_ratios 1,1
# Which files should be hidden? (regular expression)
set hidden_filter ^\.|\.(?:pyc|vrb|pyo|lof|bak|swp|aux|log|nav|out|snm|toc|bcf|run\.xml|synctex\.gz|blg|bbl)$|^lost\+found$|^__(py)?cache__$
set hidden_filter ^\.|\.(?:pyc|vrb|pyo|lof|bak|swp|aux|log|nav|out|snm|toc|bcf|run\.xml|synctex\.gz|blg|bbl|xopp~)$|^lost\+found$|^__(py)?cache__$
# Show hidden files? You can toggle this by typing 'zh'
set show_hidden false
@@ -202,16 +212,16 @@ Compress:
map ,z shell ~/.config/ranger/scripts/compress.sh %f
#+END_SRC
Get Bibtex from PDF:
#+BEGIN_SRC conf
map ,b shell pdf2bib %f
#+END_SRC
Convert images/pdf/...:
#+BEGIN_SRC conf
map ,c shell convert-file %f
#+END_SRC
Extract BibTeX:
#+begin_src conf
map ,b shell ~/.config/ranger/scripts/add-reference.sh %d/%f
#+end_src
Open SXIV on current directory:
#+BEGIN_SRC conf
map ,s shell nohup sxiv -t %d &
@@ -242,6 +252,32 @@ map ,y shell ~/.config/ranger/scripts/copy-content.sh %s &
#+end_src
** Scripts
*** Extract DOI, create BibTeX and rename file
:PROPERTIES:
:header-args: :tangle ~/.config/ranger/scripts/add-reference.sh
:header-args+: :comments both :mkdirp yes
:header-args+: :shebang "#!/usr/bin/env bash"
:END:
#+begin_src bash
add_reference () {
doi=$(pdf2doi $1 | sed 's/^DOI *//' | sed 's/ \+.*//')
# If empty DOI, ask manually
if [ -z $doi ]; then
doi=$(rofi -dmenu -p "DOI")
fi
# If DOI, add it to Emacs
if [ ! -z $doi ]; then
emacsclient --eval "(tdh-org-ref-import-pdf \"$doi\" \"$1\")" && \
dunstify --replace=49496 "BibTeX" "File copied."
else
dunstify --replace=49496 "BibTeX" "Failed to get DOI"
fi
}
add_reference "$1"
#+end_src
*** Extract Script
:PROPERTIES:
:header-args: :tangle ~/.config/ranger/scripts/extract.sh
@@ -385,8 +421,9 @@ map cd console cd%space
#+BEGIN_SRC conf
map gh cd ~/
map gw cd ~/Cloud/work-projects
map gp cd ~/Pictures
map gp cd ~/Cloud/personnal
map gP cd ~/Cloud/pictures/phone
map gs cd ~/Cloud/pictures/screenshots
map gT cd ~/.local/share/Trash/files
map gd cd ~/Downloads
map gD cd ~/Cloud/documents
@@ -415,7 +452,7 @@ map yn shell -f echo -n %f | xsel -i; xsel -o | xsel -i -b
*** Drag and Drop
#+BEGIN_SRC conf
map D shell dragon -a -x %p
map D shell dragon-drop -a -x %p
#+END_SRC
*** Rename files
@@ -591,7 +628,27 @@ copycmap <end> <C-e>
# only running the current file even if you have marked multiple files.
#+END_SRC
** Websites
#+BEGIN_SRC conf
ext x?html?, has qutebrowser, X, flag f = qutebrowser -- "$@"
ext x?html?, has firefox, X, flag f = firefox -- "$@"
ext x?html?, has elinks, terminal = elinks "$@"
ext x?html?, has w3m, terminal = w3m "$@"
#+END_SRC
** Text Files
3D files (before the rest)
#+begin_src conf
ext stp, X, flag f = f3d -- "$@"
ext step, X, flag f = f3d -- "$@"
ext stl, X, flag f = f3d -- "$@"
#+end_src
Calendar files
#+begin_src conf
ext ics, X, flag f = ics-add "$@"
#+end_src
Define the =$EDITOR= for text files as first action:
#+BEGIN_SRC conf
mime ^text, label editor = $EDITOR -- "$@"
@@ -638,6 +695,11 @@ ext djvu, has evince, X, flag f = evince -- "$@"
ext djvu, has atril, X, flag f = atril -- "$@"
#+END_SRC
** Xournalpp
#+begin_src conf
ext xopp, X, flag f = xournalpp "$@"
#+end_src
** Archives
#+BEGIN_SRC conf
ext 7z|ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz, has atool = atool -- "$@" | "$PAGER"
@@ -650,12 +712,9 @@ ext tar|gz, has tar = tar vvtf "$@" | "$PAGER"
ext tar|gz, has tar = tar vvxf "$@"
#+END_SRC
** Websites
** Torrent
#+BEGIN_SRC conf
ext x?html?, has qutebrowser, X, flag f = qutebrowser -- "$@"
ext x?html?, has firefox, X, flag f = firefox -- "$@"
ext x?html?, has elinks, terminal = elinks "$@"
ext x?html?, has w3m, terminal = w3m "$@"
ext torrent, X, flag f = stig add -- "$@"
#+END_SRC
** Word, Excel and Presentation files
@@ -715,6 +774,8 @@ ext s[wmf]c, has snes9x-gtk,X = snes9x-gtk "$1"
ext nes, has fceux, X = fceux "$1"
ext exe = wine "$1"
name ^[mM]akefile$ = make
mime application/vnd.ms-tnef = winmail-add "$@"
#+END_SRC
#+BEGIN_SRC conf
@@ -722,7 +783,7 @@ name ^[mM]akefile$ = make
!mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = ask
label editor, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = $EDITOR -- "$@"
label pager, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = "$PAGER" -- "$@"
has dragon, X, flag f = dragon -a -x "$@"
has dragon-drop, X, flag f = dragon-drop -a -x "$@"
#+END_SRC
* Ranger Commands
@@ -751,7 +812,6 @@ class fzf_select(Command):
"""
def execute(self):
import subprocess
import os.path
if self.quantifier:
# match only directories
command="find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \
@@ -760,13 +820,37 @@ class fzf_select(Command):
# match files and directories
command="find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \
-o -print 2> /dev/null | sed 1d | cut -b3- | fzf +m"
fzf = self.fm.execute_command(command, universal_newlines=True, stdout=subprocess.PIPE)
fzf = self.fm.execute_command(command, stdout=subprocess.PIPE)
stdout, stderr = fzf.communicate()
if fzf.returncode == 0:
fzf_file = os.path.abspath(stdout.rstrip('\n'))
fzf_file = os.path.abspath(stdout.decode('utf-8').rstrip('\n'))
if os.path.isdir(fzf_file):
self.fm.cd(fzf_file)
else:
self.fm.select_file(fzf_file)
# fzf_locate
class fzf_locate(Command):
"""
:fzf_locate
Find a file using fzf.
With a prefix argument select only directories.
See: https://github.com/junegunn/fzf
"""
def execute(self):
import subprocess
if self.quantifier:
command="locate home media | fzf -e -i"
else:
command="locate home media | fzf -e -i"
fzf = self.fm.execute_command(command, stdout=subprocess.PIPE)
stdout, stderr = fzf.communicate()
if fzf.returncode == 0:
fzf_file = os.path.abspath(stdout.decode('utf-8').rstrip('\n'))
if os.path.isdir(fzf_file):
self.fm.cd(fzf_file)
else:
self.fm.select_file(fzf_file)
#+end_src

View File

@@ -31,7 +31,6 @@ hide-scrollbar: true;
fullscreen: false;
dpi: -1;
show-match: true;
theme: "gruvbox-dark-soft";
kb-move-front: "Control+a";
kb-move-end: "Control+e";
kb-move-word-back: "Alt+b,Control+Left";
@@ -48,12 +47,13 @@ kb-accept-alt: "Shift+Return";
kb-delete-entry: "Shift+Delete";
kb-row-up: "Up,Control+p";
kb-row-down: "Down,Control+n";
kb-row-tab: "Tab";
kb-row-first: "Home,KP_Home";
kb-row-last: "End,KP_End";
kb-row-select: "Control+space";
kb-cancel: "Escape,Control+g";
}
@theme "gruvbox-dark-soft"
#+END_SRC
* Theme

View File

@@ -1,4 +1,4 @@
#+TITLE: Open-WRT Router (Netgear R7000)
#+TITLE: Open-WRT Router (Netgear R7800)
#+SETUPFILE: ./setup/org-setup-file.org
* Installation
@@ -7,19 +7,205 @@ https://blog.kulakowski.fr/post/openwrt-derriere-une-freebox-ipv6-dmz-et-bridge
** Enable SSL
How can I enable SSL for the web admin gui?
In an SSH-command line, run opkg update, then install the package opkg install luci-ssl, then restart the router. Then you can access https://192.168.1.1 or https://openwrt with your favorite web browser
In an SSH-command line, run =opkg update=, then install the package =opkg install luci-ssl=, then restart the router. Then you can access https://192.168.1.1 or https://openwrt with your favorite web browser
** Install useful packages
Not sure all of that is needed.
#+begin_src bash
opkg update && opkg install luci-ssl-openssl luci-theme-material ipset curl diffutils speedtest-netperf kmod-ipt-nat6
opkg update && opkg install luci-ssl-openssl ipset curl diffutils speedtest-netperf kmod-ipt-nat6
#+end_src
Nice theme:
https://github.com/jerrykuku/luci-theme-argon
* Update
This might not be a good idea.
#+begin_src matlab
opkg update
#+end_src
#+begin_src bash
opkg list-upgradable | cut -f 1 -d ' ' | xargs -r opkg upgrade
#+end_src
** Installed package (before upgrade)
#+begin_quote
ath10k-firmware-qca9984-ct - 2020-07-02-1
base-files - 204.2-r11306-c4a6851c72
busybox - 1.30.1-6
ca-bundle - 20200601-1
cgi-io - 2021-09-08-98cef9dd-20
curl - 7.66.0-3
diffutils - 3.7-2
dnsmasq - 2.80-16.3
dropbear - 2019.78-2
etherwake - 1.09-4
firewall - 2019-11-22-8174814a-3
fstools - 2020-05-12-84269037-1
fwtool - 2
getrandom - 2019-06-16-4df34a4d-4
hostapd-common - 2019-08-08-ca8c2bd2-8
ip6tables - 1.8.3-1
iperf3 - 3.7-1
ipset - 7.3-1
iptables - 1.8.3-1
iw - 5.0.1-1
iwinfo - 2019-10-16-07315b6f-1
jshn - 2020-05-25-66195aee-1
jsonfilter - 2018-02-04-c7e938d6-1
kernel - 4.14.221-1-0894164cab0effc42201a29fec8ce33f
kmod-ata-ahci - 4.14.221-1
kmod-ata-ahci-platform - 4.14.221-1
kmod-ata-core - 4.14.221-1
kmod-ath - 4.14.221+4.19.161-1-1
kmod-ath10k-ct - 4.14.221+2019-09-09-5e8cd86f-1
kmod-cfg80211 - 4.14.221+4.19.161-1-1
kmod-gpio-button-hotplug - 4.14.221-3
kmod-hwmon-core - 4.14.221-1
kmod-ip6tables - 4.14.221-1
kmod-ipt-conntrack - 4.14.221-1
kmod-ipt-core - 4.14.221-1
kmod-ipt-ipset - 4.14.221-1
kmod-ipt-nat - 4.14.221-1
kmod-ipt-nat6 - 4.14.221-1
kmod-ipt-offload - 4.14.221-1
kmod-leds-gpio - 4.14.221-1
kmod-lib-crc-ccitt - 4.14.221-1
kmod-mac80211 - 4.14.221+4.19.161-1-1
kmod-nf-conntrack - 4.14.221-1
kmod-nf-conntrack6 - 4.14.221-1
kmod-nf-flow - 4.14.221-1
kmod-nf-ipt - 4.14.221-1
kmod-nf-ipt6 - 4.14.221-1
kmod-nf-nat - 4.14.221-1
kmod-nf-nat6 - 4.14.221-1
kmod-nf-reject - 4.14.221-1
kmod-nf-reject6 - 4.14.221-1
kmod-nfnetlink - 4.14.221-1
kmod-nls-base - 4.14.221-1
kmod-ppp - 4.14.221-1
kmod-pppoe - 4.14.221-1
kmod-pppox - 4.14.221-1
kmod-scsi-core - 4.14.221-1
kmod-slhc - 4.14.221-1
kmod-usb-core - 4.14.221-1
kmod-usb-dwc3 - 4.14.221-1
kmod-usb-dwc3-of-simple - 4.14.221-1
kmod-usb-ehci - 4.14.221-1
kmod-usb-ledtrig-usbport - 4.14.221-1
kmod-usb-ohci - 4.14.221-1
kmod-usb-phy-qcom-dwc3 - 4.14.221-1
kmod-usb2 - 4.14.221-1
kmod-usb3 - 4.14.221-1
libblobmsg-json - 2020-05-25-66195aee-1
libc - 1.1.24-2
libcurl4 - 7.66.0-3
libgcc1 - 7.5.0-2
libip4tc2 - 1.8.3-1
libip6tc2 - 1.8.3-1
libipset13 - 7.3-1
libiwinfo-lua - 2019-10-16-07315b6f-1
libiwinfo20181126 - 2019-10-16-07315b6f-1
libjson-c2 - 0.12.1-3.1
libjson-script - 2020-05-25-66195aee-1
liblua5.1.5 - 5.1.5-3
liblucihttp-lua - 2019-07-05-a34a17d5-1
liblucihttp0 - 2019-07-05-a34a17d5-1
libmbedtls12 - 2.16.12-1
libmnl0 - 1.0.4-2
libnl-tiny - 0.1-5
libopenssl1.1 - 1.1.1n-1
libpthread - 1.1.24-2
libubox20191228 - 2020-05-25-66195aee-1
libubus-lua - 2022-02-21-b32a0e17-1
libubus20191227 - 2019-12-27-041c9d1c-1
libubus20210603 - 2022-02-21-b32a0e17-1
libuci20130104 - 2019-09-01-415f9e48-4
libuclient20160123 - 2020-06-17-51e16ebf-1
libustream-mbedtls20150806 - 2020-03-13-40b563b1-1
libxtables12 - 1.8.3-1
logd - 2019-06-16-4df34a4d-4
lua - 5.1.5-3
luci - git-22.115.68448-712bc8e-1
luci-app-firewall - git-22.115.68448-712bc8e-1
luci-app-opkg - git-22.115.68448-712bc8e-1
luci-base - git-22.115.68448-712bc8e-1
luci-compat - git-22.115.68448-712bc8e-1
luci-lib-ip - git-22.115.68448-712bc8e-1
luci-lib-ipkg - git-22.115.68448-712bc8e-1
luci-lib-jsonc - git-22.115.68448-712bc8e-1
luci-lib-nixio - git-22.115.68448-712bc8e-1
luci-mod-admin-full - git-22.115.68448-712bc8e-1
luci-mod-network - git-22.115.68448-712bc8e-1
luci-mod-status - git-22.115.68448-712bc8e-1
luci-mod-system - git-22.115.68448-712bc8e-1
luci-proto-ipv6 - git-22.115.68448-712bc8e-1
luci-proto-ppp - git-22.115.68448-712bc8e-1
luci-ssl - git-22.115.68448-712bc8e-1
luci-theme-argon-master - 2.2.9.4
luci-theme-bootstrap - git-22.115.68448-712bc8e-1
luci-theme-material - git-22.115.68448-712bc8e-1
mtd - 24
netifd - 2021-01-09-753c351b-1
netperf - 2.7.0-1
odhcp6c - 2021-01-09-64e1b4e7-16
odhcpd-ipv6only - 2020-05-03-49e4949c-3
openwrt-keyring - 2021-02-20-49283916-2
opkg - 2021-01-31-c5dccea9-1
perl - 5.28.1-4
perlbase-base - 5.28.1-4
perlbase-bytes - 5.28.1-4
perlbase-class - 5.28.1-4
perlbase-config - 5.28.1-4
perlbase-dynaloader - 5.28.1-4
perlbase-errno - 5.28.1-4
perlbase-essential - 5.28.1-4
perlbase-fcntl - 5.28.1-4
perlbase-filehandle - 5.28.1-4
perlbase-getopt - 5.28.1-4
perlbase-io - 5.28.1-4
perlbase-list - 5.28.1-4
perlbase-net - 5.28.1-4
perlbase-posix - 5.28.1-4
perlbase-scalar - 5.28.1-4
perlbase-selectsaver - 5.28.1-4
perlbase-socket - 5.28.1-4
perlbase-symbol - 5.28.1-4
perlbase-tie - 5.28.1-4
perlbase-time - 5.28.1-4
perlbase-xsloader - 5.28.1-4
ppp - 2.4.7.git-2019-05-25-3
ppp-mod-pppoe - 2.4.7.git-2019-05-25-3
procd - 2020-03-07-09b9bd82-1
px5g-mbedtls - 9
rpcd - 2020-05-26-67c8a3fd-1
rpcd-mod-file - 2020-05-26-67c8a3fd-1
rpcd-mod-iwinfo - 2020-05-26-67c8a3fd-1
rpcd-mod-luci - 20201107
rpcd-mod-rrdns - 20170710
speedtest-netperf - 1.0.0-1
swconfig - 12
ubi-utils - 2.1.1-1
uboot-envtools - 2018.03-3.1
ubox - 2019-06-16-4df34a4d-4
ubus - 2022-02-21-b32a0e17-1
ubusd - 2022-02-21-b32a0e17-1
uci - 2019-09-01-415f9e48-4
uclibcxx - 0.2.5-3
uclient-fetch - 2020-06-17-51e16ebf-1
uhttpd - 2020-10-01-3abcc891-1
umdns - 2020-04-25-cdac0460-1
urandom-seed - 1.0-1
urngd - 2020-01-21-c7f7b6b6-1
usign - 2020-05-23-f1f65026-1
wakeonlan - 0.41-1
wireless-regdb - 2021.08.28-1
wpad-basic - 2019-08-08-ca8c2bd2-8
#+end_quote
* Configuration
** Configuration Files
https://openwrt.org/docs/guide-user/base-system/uci#common_principles
Configuration files are in =/etc/config=.
@@ -32,3 +218,51 @@ Configuration files are in =/etc/config=.
| =/etc/config/network= | Switch, interface and route configuration: |
| =/etc/config/system= | Misc. system settings, NTP, RNG, Watchcat |
| =/etc/config/wireless= | Wireless settings and wifi network definition |
** VLAN
| ID | Name | Description |
|----+-----------+-------------|
| 1 | LAN | |
| 2 | WAN | |
| 3 | GUEST | |
| 4 | IOT | |
| 5 | Unifi-LAN | |
** TODO IP Addresses
*** LAN
| Hostname | MAC-Address | IPv4-Address | Description |
|-----------------+-------------------+---------------+-------------|
| xps13 | 94:05:BB:13:6E:55 | 192.168.1.71 | |
| desktop-w10 | 14:DA:E9:D5:9D:F4 | 192.168.1.72 | |
| smart-tv | 5C:85:7E:45:F9:82 | 192.168.1.73 | |
| unifi-u6-lite-1 | 70:A7:41:C6:BE:60 | 192.168.1.74 | |
|-----------------+-------------------+---------------+-------------|
| homelab | D4:5D:64:7C:38:3C | 192.168.1.21 | |
|-----------------+-------------------+---------------+-------------|
| oneplus8 | 5A:C7:3D:21:DE:D7 | 192.168.1.101 | |
|-----------------+-------------------+---------------+-------------|
| valetudo | 7C:25:DA:37:A5:BC | 192.168.1.110 | |
*** IOT
| Hostname | MAC-Address | IPv4-Address | Description |
|-------------------------------+-------------------+---------------------+-------------|
| http://shutter-1.lan/ | C4:5B:BE:5F:C8:32 | http://192.168.2.10 | Shutters |
| http://shutter-2.lan/ | C4:5B:BE:5F:3A:E2 | http://192.168.2.11 | |
| http://shutter-3.lan/ | C4:5B:BE:5F:35:41 | http://192.168.2.12 | |
| http://shutter-salon.lan/ | 48:3F:DA:49:24:01 | http://192.168.2.13 | (ESP8266) |
|-------------------------------+-------------------+---------------------+-------------|
| http://shelly1-1.lan/ | E8:68:E7:86:C1:2C | http://192.168.2.20 | Light-bulbs |
| http://shelly1-2.lan/ | E8:68:E7:87:46:51 | http://192.168.2.21 | |
| http://shelly1-3.lan/ | 8C:AA:B5:74:CD:16 | http://192.168.2.22 | |
| http://shelly1-salon.lan/ | E8:68:E7:87:27:1D | http://192.168.2.24 | |
| http://shelly25-cuisine.lan/ | 98:CD:AC:1E:11:8E | http://192.168.2.25 | |
| http://shelly25-entrance.lan/ | C4:5B:BE:6B:87:39 | http://192.168.2.26 | |
|-------------------------------+-------------------+---------------------+-------------|
| http://xiaomi-ble.lan/ | 3C:61:05:12:A8:C4 | http://192.168.2.28 | Temperature |
|-------------------------------+-------------------+---------------------+-------------|
| http://shellytrv-1.lan/ | BC:33:AC:03:35:8C | http://192.168.2.40 | TRV |
| http://shellytrv-2.lan/ | 60:A4:23:DC:C7:1E | http://192.168.2.41 | |
| http://shellytrv-3.lan/ | 60:A4:23:DC:C8:14 | http://192.168.2.42 | |
| http://shellytrv-s.lan/ | 60:A4:23:DB:2B:76 | http://192.168.2.43 | |
| http://shellytrv-e.lan/ | 60:A4:23:DB:2C:8C | http://192.168.2.44 | |

View File

@@ -1,20 +0,0 @@
#+TITLE: Smart TV
#+SETUPFILE: ./setup/org-setup-file.org
* Hardware
MINISFORUM X35G Mini PC
#+caption: Smart TV Hardware
| *Part* | *Model* |
|-------------+----------------------------------------|
| CPU | 10th Gen Intel Core i3-1005G |
| RAM | 16Go (2x8Go) DDR4 3200MHz |
| SSD NVME | 512Gb |
* Installation
- Manjaro KDE
- Install =paru=
- Install Jellyfin, Molotov, Spotify, ...
- SSH access

126
squeezelite.org Normal file
View File

@@ -0,0 +1,126 @@
#+title: Squeezelite
* Installation
Install OS: Raspberry Pi OS Lite (Debian GNU/Linux 12: bookworm)
Setup SSH Authentication
#+begin_src bash :eval no
# On Raspberry Pi
ssh-keygen -t ed25519 -f ~/.ssh/lms_tunnel -N ""
cat ~/.ssh/lms_tunnel.pub
#+end_src
Copy the public key on =homelab=
Change =.ssh/config=
#+begin_src conf
Host homelab
hostname 82.66.44.13
Port 22
user thomas
IdentityFile ~/.ssh/lms_tunnel
#+end_src
Test the SSH connection:
#+begin_src bash :eval no
ssh homelab
#+end_src
Install packages:
#+begin_src bash :eval no
sudo apt update
sudo apt install autossh avahi-daemon
#+end_src
Create service: =/etc/systemd/system/lms-tunnel.service=
#+begin_src conf
[Unit]
Description=LMS SSH Tunnel
After=network.target
[Service]
User=pi
ExecStart=/usr/bin/autossh -M 0 -N \
-o "ServerAliveInterval 30" \
-o "ServerAliveCountMax 3" \
-o "ExitOnForwardFailure yes" \
-o "IdentitiesOnly yes" \
-o "TCPKeepAlive yes" \
-o "Compression yes" \
-i /home/pi/.ssh/lms_tunnel \
-L 0.0.0.0:9000:localhost:9000 \
-L 0.0.0.0:3483:localhost:3483 \
-L 0.0.0.0:9090:localhost:9090 \
thomas@82.66.44.13
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
#+end_src
Enable the service: =sudo systemctl enable --now lms-tunnel.service=
Set Up Avahi for LMS Service Discovery: =/etc/avahi/services/squeezebox.service=
#+begin_src conf
<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name>Logitech Media Server</name>
<service>
<type>_slimdevices._tcp</type>
<port>3483</port>
</service>
</service-group>
#+end_src
Restart Avahi: =sudo systemctl restart avahi-daemon=.
#+begin_src bash :eval no
# Check tunnel status
sudo systemctl status lms-tunnel.service
# Check if ports are being forwarded
sudo netstat -tulpn | grep -E '9000|3483|9090'
#+end_src
Troubleshooting: =sudo systemctl status lms-tunnel.service=
Create the service for Holo Player service: =/etc/systemd/system/holo-audio-player.service=
#+begin_src yaml
[Unit]
Description=Holo Audio DAC Squeezebox Player
After=network-online.target sound.target lms-tunnel.service
Wants=network-online.target
Requires=lms-tunnel.service
[Service]
Type=simple
User=root
ExecStart=/usr/bin/squeezelite \
-o plughw:CARD=Enhanc,DEV=0 \
-s localhost \
-n HoloAudioDAC \
-a 2000:4:24:1 \
-b 4096:8192 \
-r 44100,48000,96000,192000 \
-p 55 \
-C 5 \
-d all=info \
-f /var/log/squeezelite.log
Restart=always
RestartSec=10
Nice=-10
LimitRTPRIO=99
LimitMEMLOCK=infinity
[Install]
WantedBy=multi-user.target
#+end_src
=sudo systemctl enable --now holo-audio-player.service=
To see the logs in real time: =tail -f /var/log/squeezelite.log=

View File

@@ -42,56 +42,51 @@ super + shift + d
setxkbmap -layout us -option caps:escape
#+end_src
Notifications:
#+begin_src conf
alt + space
dunstctl close
alt + BackSpace
dunstctl history-pop
#+end_src
* Multimedia keys
** Sound
#+begin_src conf
# Mute/Unmute
XF86AudioMute
amixer -D pulse sset Master toggle
pactl set-sink-mute @DEFAULT_SINK@ toggle
# Increase Volume
XF86AudioRaiseVolume
amixer -D pulse sset Master 2%+
pactl -- set-sink-volume 0 +2%
# Decrease Volume
XF86AudioLowerVolume
amixer -D pulse sset Master 2%-
pactl -- set-sink-volume 0 -2%
#+end_src
** Backlight
#+begin_src conf
# Increase Backlight
XF86MonBrightnessUp
xbacklight -inc 10
light -A 10
# Descrease Backlight
XF86MonBrightnessDown
xbacklight -dec 10
light -U 10
#+end_src
** Change Tracks
#+begin_src conf
# Play/Pause music
super + period
mpc toggle
playerctl --player=jellyfin-tui play-pause
# Previous/Next music
super + {greater,less}
mpc {next,prev}
#+end_src
#+begin_src conf
# Play/Pause music
XF86AudioPlay
mpc toggle
# Next music
XF86AudioNext
mpc next
# Previous music
XF86AudioPrev
mpc prev
playerctl --player=jellyfin-tui {next,previous}
#+end_src
** Print Screen
@@ -132,9 +127,17 @@ super + z
super + Return
$TERMINAL
# Start Terminal (floating)
super + shift + Return
$TERMINAL --class floating
# File Manager
super + o
$TERMINAL -e tmux new-session -A -s ranger ranger
$TERMINAL -e tmux new-session -A -s yazi yazi
# Unicode Insert
super + u
insert-unicode
# Browser
super + i
@@ -145,6 +148,9 @@ super + m
$TERMINAL -e tmux new-session -A -s neomutt neomutt
# Emacs Client
super + shift + e
emacs
super + e
emacsclient -create-frame --alternate-editor=""
#+end_src
@@ -157,15 +163,19 @@ super + shift + b
# Calculator
super + shift + c
rofi-calc
rofi -show calc -modi calc -no-show-match -no-sort -calc-command "echo -n '\{result\}' | xclip -selection clipboard"
# Sound Manager
super + shift + s
pavucontrol
pwvucontrol
# Passwords
super + shift + p
rofi-pass
# Fill ESRF password
super + shift + f
xdotool key $(pass esrf.fr/dehaeze | head -n 1 | sed 's/./& /g' | sed 's/}/braceright/g')
#+end_src
* =Super + Space= - Command Mode
@@ -176,27 +186,23 @@ super + space ; c
# pcmanfm: GUI file manager
super + space ; o
nautilus;
pcmanfm;
# Run another instance of Neomutt in read-only mode
super + space ; m
$TERMINAL -e neomutt -R
# Music with ncmpcpp
# Matrix Client
super + space ; w
$TERMINAL -e tmux new-session -A -s gomuks gomuks
# Music with ncmpcpp
super + space ; p
$TERMINAL -e tmux new-session -A -s ncmpcpp ncmpcpp
$TERMINAL --class jellyfin-tui -e tmux new-session -A -s jellyfin jellyfin-tui
# Default Browser
super + space ; i
$BROWSER;
# Emacs
super + space ; e
emacsclient -create-frame --alternate-editor=""
# TODO Torrent Client with stig
super + space ; t
$TERMINAL -e tmux new-session -A -s stig stig
#+end_src
* I3 related

View File

@@ -15,8 +15,11 @@ https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-
Description=Sync Brain Website everyday
RefuseManualStart=no
RefuseManualStop=yes
OnFailure=notify-via-gotify@%i.service
[Service]
Environment="PASSWORD_STORE_DIR=/home/thomas/.local/share/pass"
Environment="GNUPGHOME=/home/thomas/.local/share/gnupg"
Type=oneshot
ExecStart=%h/.local/bin/brain_git_push
#+END_SRC
@@ -36,8 +39,9 @@ Wants=network-online.target
After=network-online.target
[Timer]
OnCalendar=*-*-* 16:00:00
Persistent=true
Persistent=false
OnBootSec=30min
OnUnitActiveSec=1d
Unit=braingit.service
[Install]
@@ -52,7 +56,7 @@ WantedBy=default.target
:END:
#+begin_src bash
cd ~/Cloud/programming/brain-website/
cd /home/thomas/Cloud/programming/brain-website/
if [[ ! -z $(git status -s content/) ]]
then
@@ -63,6 +67,93 @@ then
fi
#+end_src
* =notify-via-gotify= - Notify
** Service
:PROPERTIES:
:header-args: :tangle ~/.config/systemd/user/notify-via-gotify@.service
:header-args+: :comments both :mkdirp yes
:END:
#+begin_src conf
[Unit]
Description=%i failure notification over gotify
[Service]
Environment="PASSWORD_STORE_DIR=/home/thomas/.local/share/pass"
Environment="GNUPGHOME=/home/thomas/.local/share/gnupg"
Type=oneshot
ExecStart=/bin/bash -c "systemctl status -n10 %i | ~/.local/bin/create-gotify-notification-for-systemd --unit %i --host %H | curl -XPOST \"https://gotify.tdehaeze.xyz/message?token=$(pass nas/gotify_notif_token | sed -n 1p)\" -H \"Content-Type: application/json\" --data-binary @-"
#+end_src
** Script
:PROPERTIES:
:header-args: :tangle ~/.local/bin/create-gotify-notification-for-systemd
:header-args+: :comments both :mkdirp yes
:header-args+: :shebang "#!/usr/bin/env python3"
:END:
#+begin_src python
import json
import argparse
import sys
TITLE_TEMPLATE = "Systemd unit failed"
MESSAGE_TEMPLATE = "Systemd unit {unit} failed on host {host}."
def main():
arguments = parse_arguments()
status = "\n".join(" " + line.rstrip() for line in sys.stdin.readlines())
message = MESSAGE_TEMPLATE.format(unit=arguments.unit, host=arguments.host, status=status)
title = TITLE_TEMPLATE.format(unit=arguments.unit, host=arguments.host)
output = create_gotify_json(title, message, arguments.priority)
print(output)
def parse_arguments():
parser = argparse.ArgumentParser(
description="Create Gotify notification for failing systemd unit",
)
parser.add_argument(
"--unit",
default="unknown",
help="the failing systemd unit name",
)
parser.add_argument(
"--host",
default="unknown",
help="the failing systemd unit host",
)
parser.add_argument(
"--priority",
default="5",
type=int,
help="the notification priority",
)
return parser.parse_args()
def create_gotify_json(title, message, priority):
data = {
"title": title,
"message": message,
"priority": priority,
"extras": {
"client::display": {
"contentType": "text/markdown"
},
},
}
return json.dumps(data)
if __name__ == '__main__':
main()
#+end_src
* =checkmail= - Check new mails
** Service
:PROPERTIES:
@@ -75,8 +166,11 @@ fi
Description=Check new mails
RefuseManualStart=no
RefuseManualStop=yes
OnFailure=notify-via-gotify@%i.service
[Service]
Environment="PASSWORD_STORE_DIR=/home/thomas/.local/share/pass"
Environment="GNUPGHOME=/home/thomas/.local/share/gnupg"
Type=oneshot
ExecStart=%h/.local/bin/checkmail -q
#+END_SRC
@@ -94,7 +188,6 @@ RefuseManualStart=no
RefuseManualStop=no
Wants=network-online.target
After=network-online.target
Requires=checkmail.service
[Timer]
Persistent=false
@@ -125,45 +218,24 @@ while [ -n "$1" ]; do # while loop starts
shift
done
# Count number of new mails before retreiving mails
gmail_old="$(ls ~/.local/share/mails/gmail/Inbox/new | wc -l)"
esrf_old="$(ls ~/.local/share/mails/esrf/Inbox/new | wc -l)"
# =============================================================
# Count number of mails
gmail_old="$(ls ~/.mail/gmail/Inbox/new | wc -l)"
esrf_old="$(ls ~/.mail/esrf/Inbox/new | wc -l)"
# =============================================================
# =============================================================
# Retreive mails
mbsync $opt_all $opt_verbose gmail-Home esrf-Home 2>/tmp/mbsync.log
# =============================================================
mbsync -c /home/thomas/.config/isync/mbsyncrc $opt_all $opt_verbose gmail-Home esrf-Home 2>/tmp/mbsync.log
# =============================================================
# Count number of mails
gmail_new="$(ls ~/.mail/gmail/Inbox/new | wc -l)"
esrf_new="$(ls ~/.mail/esrf/Inbox/new | wc -l)"
# =============================================================
# Count number of new mails after retreiving mails
gmail_new="$(ls ~/.local/share/mails/gmail/Inbox/new | wc -l)"
esrf_new="$(ls ~/.local/share/mails/esrf/Inbox/new | wc -l)"
# =============================================================
# Total Number of new mails since last checking
new="$(($esrf_new+$gmail_new))"
old="$(($esrf_old+$gmail_old))"
# =============================================================
# =============================================================
# Notification
if [ "$new" -gt 0 ]; then
notify-send --hint=string:x-dunst-stack-tag:fV84ivMi 'Mails ' "$new new mail(s)"
# Notification if there are new retreive mails
if [ "$(($esrf_new+$gmail_new))" -gt "$(($esrf_old+$gmail_old))" ]; then
dunstify --replace=98465 'Mails ' "$(($gmail_new+$esrf_new)) new mail(s)"
fi
# =============================================================
# =============================================================
# Indexation and Tags
if pgrep -f 'mu server'; then
emacsclient --eval '(mu4e-update-index)'
else
mu index -m ~/.mail $opt_verbose $opt_quiet
fi
# =============================================================
mu index $opt_verbose $opt_quiet
#+end_src
* =syncmail= - Synchronize all mails
@@ -178,8 +250,11 @@ fi
Description=Sync all mails
RefuseManualStart=no
RefuseManualStop=yes
OnFailure=notify-via-gotify@%i.service
[Service]
Environment="PASSWORD_STORE_DIR=/home/thomas/.local/share/pass"
Environment="GNUPGHOME=/home/thomas/.local/share/gnupg"
Type=oneshot
ExecStart=%h/.local/bin/checkmail -a -q
#+END_SRC
@@ -197,7 +272,6 @@ RefuseManualStart=no
RefuseManualStop=no
Wants=network-online.target
After=network-online.target
Requires=syncmail.service
[Timer]
Persistent=false
@@ -223,9 +297,12 @@ Description=Synchronize calendars and contacts
Documentation=https://vdirsyncer.readthedocs.org/
Wants=network-online.target
After=network-online.target
OnFailure=notify-via-gotify@%i.service
[Service]
ExecStart=/home/thomas/.local/bin/vdirsyncer --verbosity "ERROR" sync
Environment="PASSWORD_STORE_DIR=/home/thomas/.local/share/pass"
Environment="GNUPGHOME=/home/thomas/.local/share/gnupg"
ExecStart=/usr/bin/vdirsyncer --verbosity "ERROR" sync
Type=oneshot
#+end_src
@@ -248,89 +325,13 @@ AccuracySec=5m
WantedBy=timers.target
#+end_src
* TODO =ssh-agent= - SSH Agent
** Service
:PROPERTIES:
:header-args: :tangle ~/.config/systemd/user/ssh-agent.service
:header-args+: :comments both :mkdirp yes
:END:
#+begin_src conf
[Unit]
Description=SSH key agent
[Service]
Type=simple
Environment=SSH_AUTH_SOCK=%t/ssh-agent.socket
ExecStart=/usr/bin/ssh-agent -D -a $SSH_AUTH_SOCK
[Install]
WantedBy=default.target
#+end_src
* TODO =emacs= - Emacs
** Service
:PROPERTIES:
:header-args: :tangle ~/.config/systemd/user/emacs.service
:header-args+: :comments both :mkdirp yes
:END:
#+begin_src conf
[Unit]
Description=Emacs text editor
Documentation=info:emacs man:emacs(1) https://gnu.org/software/emacs/
[Service]
Type=simple
ExecStart=/usr/bin/emacs --fg-daemon
ExecStop=/usr/bin/emacsclient --eval "(kill-emacs)"
Environment=SSH_AUTH_SOCK=%t/keyring/ssh
Restart=on-failure
[Install]
WantedBy=default.target
#+end_src
* TODO =trash-empty= - Empty the trash for files older than 30 days
** Service
:PROPERTIES:
:header-args: :tangle ~/.config/systemd/user/trash-empty.service
:header-args+: :comments both :mkdirp yes
:END:
#+begin_src conf
[Unit]
Description=Empty the trash for files older than 30 days
Documentation=https://github.com/andreafrancia/trash-cli
[Service]
ExecStart=/home/thomas/.local/bin/trash-empty 30
Type=oneshot
#+end_src
** Timer
:PROPERTIES:
:header-args: :tangle ~/.config/systemd/user/trash-empty.timer
:header-args+: :comments both :mkdirp yes
:END:
#+begin_src conf
[Unit]
Description=Empty trash
[Timer]
OnCalendar=*-*-* 16:00:00
Persistent=true
Unit=trash-empty
[Install]
WantedBy=timers.target
#+end_src
* =syncthing=
* =syncthing= - Synchronize =Cloud= directory
** Service
:PROPERTIES:
:header-args: :tangle ~/.config/systemd/user/syncthing.service
:header-args+: :comments both :mkdirp yes
:END:
#+begin_src conf
[Unit]
Description=Syncthing - Open Source Continuous File Synchronization for %I
@@ -339,7 +340,7 @@ After=network.target
[Service]
Environment="all_proxy=socks5://localhost:8080"
ExecStart=/usr/bin/syncthing -no-browser -gui-address="0.0.0.0:8384" -no-restart -logflags=0
ExecStart=/usr/bin/syncthing --no-browser --gui-address="0.0.0.0:8384" --no-restart --logflags=0
Restart=on-failure
SuccessExitStatus=3 4
RestartForceExitStatus=3 4
@@ -348,6 +349,150 @@ RestartForceExitStatus=3 4
WantedBy=default.target
#+end_src
* =restic-backup= - Backup Home Directory
** Backup
*** Service
:PROPERTIES:
:header-args: :tangle ~/.config/systemd/user/restic-backup.service
:header-args+: :comments both :mkdirp yes
:END:
#+BEGIN_SRC conf
[Unit]
Description=Backup Home Directory
RefuseManualStart=no
RefuseManualStop=no
OnFailure=notify-via-gotify@%i.service
[Service]
Environment="PASSWORD_STORE_DIR=/home/thomas/.local/share/pass"
Environment="GNUPGHOME=/home/thomas/.local/share/gnupg"
Type=oneshot
ExecStart=%h/.local/bin/restic-backup
ExecStartPost=/bin/sleep 30
ExecStartPost=%h/.local/bin/restic-forget
#+END_SRC
*** Timer
:PROPERTIES:
:header-args: :tangle ~/.config/systemd/user/restic-backup.timer
:header-args+: :comments both :mkdirp yes
:END:
#+BEGIN_SRC conf
[Unit]
Description=Backup Home Directory Everyday
RefuseManualStart=no
RefuseManualStop=no
Wants=network-online.target
[Timer]
Persistent=true
OnCalendar=daily
Unit=restic-backup.service
[Install]
WantedBy=default.target
#+END_SRC
*** Script - Backup
:PROPERTIES:
:header-args: :tangle ~/.local/bin/restic-backup
:header-args+: :comments both :mkdirp yes
:header-args+: :shebang "#!/usr/bin/env bash"
:END:
#+begin_src bash
restic backup \
-r sftp:thomas@homelab:/srv/storage/Backups/esrf-laptop \
--password-command "pass show restic" \
--verbose --one-file-system --tag systemd.timer \
--exclude "/home/thomas/.cache" \
--exclude "/home/thomas/.local/data/docker" \
--exclude "/home/thomas/.local/soft" \
--exclude "/home/thomas/Cloud" \
--exclude "/home/thomas/mnt" \
/home/thomas
#+end_src
*** Script - Forget
:PROPERTIES:
:header-args: :tangle ~/.local/bin/restic-forget
:header-args+: :comments both :mkdirp yes
:header-args+: :shebang "#!/usr/bin/env bash"
:END:
#+begin_src bash
restic unlock \
-r sftp:thomas@homelab:/srv/storage/Backups/esrf-laptop \
--password-command "pass show restic" && \
restic forget \
-r sftp:thomas@homelab:/srv/storage/Backups/esrf-laptop \
--password-command "pass show restic" \
--verbose --tag systemd.timer \
--group-by "paths,tags" \
--keep-daily 7 \
--keep-weekly 4 \
--keep-monthly 1 \
--keep-yearly 1
#+end_src
** Prune
*** Service
:PROPERTIES:
:header-args: :tangle ~/.config/systemd/user/restic-prune.service
:header-args+: :comments both :mkdirp yes
:END:
#+BEGIN_SRC conf
[Unit]
Description=Prune restic backup
RefuseManualStart=no
RefuseManualStop=no
OnFailure=notify-via-gotify@%i.service
[Service]
Environment="PASSWORD_STORE_DIR=/home/thomas/.local/share/pass"
Environment="GNUPGHOME=/home/thomas/.local/share/gnupg"
Type=oneshot
ExecStart=%h/.local/bin/restic-prune
#+END_SRC
*** Timer
:PROPERTIES:
:header-args: :tangle ~/.config/systemd/user/restic-prune.timer
:header-args+: :comments both :mkdirp yes
:END:
#+BEGIN_SRC conf
[Unit]
Description=Prune Restic Backup
RefuseManualStart=no
RefuseManualStop=no
Wants=network-online.target
[Timer]
Persistent=true
OnCalendar=monthly
Unit=restic-prune.service
[Install]
WantedBy=default.target
#+END_SRC
*** Script
:PROPERTIES:
:header-args: :tangle ~/.local/bin/restic-prune
:header-args+: :comments both :mkdirp yes
:header-args+: :shebang "#!/usr/bin/env bash"
:END:
#+begin_src bash
restic prune \
-r sftp:thomas@homelab:/srv/storage/Backups/esrf-laptop \
--password-command "pass show restic" \
#+end_src
* =homelab-tunnel= - SSH Tunnel
Useful to bypass firewalls.
This can we used on the browser:
@@ -390,7 +535,7 @@ Description=Setup a secure tunnel with ESRF
After=network.target
[Service]
ExecStart=/usr/bin/ssh -o ServerAliveInterval=60 -o ExitOnForwardFailure=yes -D 8081 -q -N -T rnice.esrf.fr
ExecStart=/usr/bin/ssh -o ServerAliveInterval=60 -o ExitOnForwardFailure=yes -D 8081 -q -N -T firewall.esrf.fr
# Restart every >2 seconds to avoid StartLimitInterval failure
RestartSec=5

View File

@@ -1,5 +1,8 @@
#+TITLE: Drawing Tablet - Xournal
#+SETUPFILE: ./setup/org-setup-file.org
#+PROPERTY: header-args:bash :comments both :mkdirp yes
#+PROPERTY: header-args:bash+ :shebang "#!/usr/bin/env bash"
#+PROPERTY: header-args:bash+ :tangle-mode (identity #o555)
* =xournalpp=
@@ -50,3 +53,48 @@ Special lines in =settings.xml=:
<property name="eagerPageCleanup" value="true"/>
<property name="pageTemplate" value="xoj/template&#10;copyLastPageSettings=false&#10;size=600.0x400.0&#10;backgroundType=plain&#10;backgroundColor=#ffffff&#10;"/>
#+end_src
* Automatically configure tablet
See [[https://unix.stackexchange.com/questions/65788/why-doesnt-xsetwacom-work-from-udev][here]].
=sudoedit /etc/udev/rules.d/99-huion-tablet.rules=
#+begin_src conf :tangle no
SUBSYSTEM=="usb", ACTION=="add", ATTR{idVendor}=="256c", ATTRS{idProduct}=="006d", RUN="/home/thomas/.local/scripts/setup-huion-tablet.sh"
#+end_src
Then two scripts are used.
The first one is just used to call the second one in the background
#+begin_src bash :tangle ~/.local/scripts/setup-huion-tablet.sh
/home/thomas/.local/scripts/setup-huion-tablet-script.sh &
#+end_src
And this is the second one with the actual config:
#+begin_src bash :tangle ~/.local/scripts/setup-huion-tablet-script.sh
sleep 2
DISPLAY=:0
XAUTHORITY=/home/thomas/.Xauthority
export DISPLAY XAUTHORITY
# Pen Buttons
xsetwacom set "HUION Huion Tablet_H320M stylus" button 1 1 # Left click
xsetwacom set "HUION Huion Tablet_H320M stylus" button 2 2 # Right click
xsetwacom set "HUION Huion Tablet_H320M stylus" button 3 3 # Middle click
# Top Buttons
xsetwacom set "HUION Huion Tablet_H320M pad" button 1 "key Ctrl T" # Tools
xsetwacom set "HUION Huion Tablet_H320M pad" button 2 "key Ctrl Shift A" # Hand Tool
xsetwacom set "HUION Huion Tablet_H320M pad" button 3 "key Ctrl Shift D" # Default Tool
# Round Buttons (Top, Bottom, Middle, Left, Right)
xsetwacom set "HUION Huion Tablet_H320M pad" button 8 "key Ctrl Shift +" # Zoom
xsetwacom set "HUION Huion Tablet_H320M pad" button 9 "key Ctrl -" # Unzoom
xsetwacom set "HUION Huion Tablet_H320M pad" button 10 "key Ctrl S" # Save
xsetwacom set "HUION Huion Tablet_H320M pad" button 11 "key Ctrl Z" # Undo
xsetwacom set "HUION Huion Tablet_H320M pad" button 12 "key Ctrl Y" # Redo
# Bottom Buttons
xsetwacom set "HUION Huion Tablet_H320M pad" button 13 "key Ctrl Shift O" # Select
xsetwacom set "HUION Huion Tablet_H320M pad" button 14 "key Ctrl Shift E" # Errase
xsetwacom set "HUION Huion Tablet_H320M pad" button 15 "key Ctrl Q" # Quit
#+end_src

View File

@@ -1,12 +1,12 @@
#+TITLE: Tmux Configuration
#+SETUPFILE: ./setup/org-setup-file.org
#+PROPERTY: header-args :tangle ~/.tmux.conf
#+PROPERTY: header-args :tangle ~/.config/tmux/tmux.conf
#+PROPERTY: header-args+ :comments both :mkdirp yes
* Line
#+begin_src conf
# Activate the status bar
set -g status "on"
set -g status off
# default statusbar color
set-option -g status-style bg=colour237,fg=colour223 # bg=bg1, fg=fg1

View File

@@ -1,50 +1,33 @@
#+TITLE: Torrent Configuration
#+SETUPFILE: ./setup/org-setup-file.org
* =tremc= - Curses interface for Transmission
https://github.com/tremc/tremc
* =stig= - TUI and CLI for Transmission ([[https://github.com/rndusr/stig][link]])
#+begin_src conf :comments none :mkdirp yes :tangle ~/.config/tremc/settings.cfg :noweb no-export
[Connection]
password = <<get-password(passname="nas/transmission")>>
username = tdehaeze
port = 9091
host = torrent.tdehaeze.xyz
path = /transmission/rpc/
ssl = False
#+begin_src conf :comments none :mkdirp yes :tangle ~/.config/stig/rc :noweb no-export
# Host that runs Transmission daemon
set connect.host <<get-password(passname="ip/homelab")>>
set connect.port 9091
set connect.tls false
set connect.user tdehaeze
set connect.host <<get-password(passname="nas/transmission")>>
set connect.path /
set connect.url /transmission/
[Sorting]
order = name
# Update torrent/peer/file/etc lists every 10 seconds
set tui.poll 10
[Filtering]
filter =
invert = False
# Tabs
tab ls all --columns size,ratio,status,rate-down,rate-up,%downloaded,name
tab -b ls peers
tab -b ls uploading
tab -b ls downloading
[Misc]
compact_list = False
torrentname_is_progressbar = True
file_viewer = xdg-open %%s
file_open_in_terminal = True
[Colors]
title_seed = bg:green,fg:black
title_download = bg:blue,fg:black
title_idle = bg:cyan,fg:black
title_verify = bg:magenta,fg:black
title_paused = bg:black,fg:white
title_error = bg:red,fg:white
download_rate = bg:black,fg:blue
upload_rate = bg:black,fg:red
eta+ratio = bg:black,fg:white
filter_status = bg:red,fg:black
dialog = bg:black,fg:white
dialog_important = bg:red,fg:black
button = bg:white,fg:black
button_focused = bg:black,fg:white
file_prio_high = bg:red,fg:black
file_prio_normal = bg:white,fg:black
file_prio_low = bg:yellow,fg:black
file_prio_off = bg:blue,fg:black
# Default columns in torrent lists
set columns.torrents marked eta %downloaded status rate-down rate-up size seeds peers name
set columns.peers host client %downloaded rate-down rate-up rate-est eta
set columns.files marked priority %downloaded downloaded size name
set columns.trackers tier domain error last-announce next-announce leeches seeds downloads
set columns.settings name value default description
#+end_src
* =aria2c= - Lightweight download utility
@@ -65,15 +48,15 @@ on-download-error=/home/thomas/.config/aria2/download-error.sh
** Download Start Script
#+begin_src bash :tangle ~/.config/aria2/download-start.sh :comments both :mkdirp yes :shebang "#!/bin/bash"
notify-send --hint=string:x-dunst-stack-tag:bHEPn7rW "DL Started" "$(basename \"$3\" 2> /dev/null)"
dunstify "DL Started" "$(basename \"$3\" 2> /dev/null)"
#+end_src
** Download Complete Script
#+begin_src bash :tangle ~/.config/aria2/download-complete.sh :comments both :mkdirp yes :shebang "#!/usr/bin/env bash"
notify-send --hint=string:x-dunst-stack-tag:bHEPn7rW "DL Completed" "$(basename \"$3\" 2> /dev/null)"
dunstify "DL Completed" "$(basename \"$3\" 2> /dev/null)"
#+end_src
** Download Error Script
#+begin_src bash :tangle ~/.config/aria2/download-error.sh :comments both :mkdirp yes :shebang "#!/usr/bin/env bash"
notify-send --hint=string:x-dunst-stack-tag:bHEPn7rW --urgency=critical "DL Failed" "$(basename \"$3\" 2> /dev/null)"
dunstify --urgency=critical "DL Failed" "$(basename \"$3\" 2> /dev/null)"
#+end_src

View File

@@ -28,8 +28,6 @@ alang=en,fr
# Do not close mpv at the end of video
keep-open=yes
script-opts=ytdl_hook-ytdl_path=/home/thomas/miniconda3/bin/yt-dlp
#+end_src
* =input.conf= - MPV Key Bindings

238
vim.org
View File

@@ -2,12 +2,12 @@
#+SETUPFILE: ./setup/org-setup-file.org
#+PROPERTY: header-args :comments none
#+PROPERTY: header-args+ :mkdirp yes
#+PROPERTY: header-args+ :tangle ~/.vimrc
#+PROPERTY: header-args+ :tangle ~/.config/nvim/init.vim
* Plugins Install
** Plug start
#+BEGIN_SRC vimrc
call plug#begin('~/.vim/plugged')
call plug#begin('~/.config/nvim/plugged')
#+end_src
** Manage Files
@@ -34,7 +34,6 @@ Plug 'jiangmiao/auto-pairs' " Vim plugin, insert or delete brackets,
** Git
#+begin_src vimrc
" Plug 'mhinz/vim-signify' " Show a diff using Vim its sign column
Plug 'TimUntersberger/neogit'
#+end_src
@@ -78,7 +77,7 @@ Plug 'morhetz/gruvbox' " Retro groove color scheme for Vim
Other nice themes are [[https://github.com/mhartington/oceanic-next][oceanic-next]] and [[https://github.com/jacoborus/tender.vim][tender]].
** TODO Language Server Protocol
** Language Server Protocol
#+begin_src vimrc
" LSP Support
Plug 'neovim/nvim-lspconfig'
@@ -97,34 +96,16 @@ Plug 'L3MON4D3/LuaSnip'
Plug 'rafamadriz/friendly-snippets'
Plug 'VonHeikemen/lsp-zero.nvim'
#+end_src
#+begin_src vimrc
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
#+end_src
** Snippnets and autocompletion
#+begin_src vimrc
" Plug 'SirVer/ultisnips' " The ultimate snippet solution for Vim
" Plug 'honza/vim-snippets' " Vim-snipmate default snippets
#+end_src
** Syntax Checking and Build Utils
#+begin_src vimrc
" Plug 'neomake/neomake' " Asynchronous linting and make framework for Neovim/Vim
#+end_src
** Tmux
#+begin_src vimrc
Plug 'christoomey/vim-tmux-navigator' " Seamless navigation between tmux panes and vim splits
Plug 'jpalardy/vim-slime' " Used to type text into a REPL
#+end_src
** Syntax
#+begin_src vimrc
" Plug 'sheerun/vim-polyglot' " A solid language pack for Vim
#+end_src
** LaTeX
#+begin_src vimrc
" Plug 'lervag/vimtex', { 'for': 'tex' } " A modern vim plugin for editing LaTeX files.
@@ -136,6 +117,20 @@ Plug 'tdehaeze/matlab-vim', { 'for': 'matlab' } " Edit Matlab M-files in Vim
Plug 'djoshea/vim-matlab-fold', { 'for': 'matlab' } " Vim code folding for Matlab files
#+end_src
** PlatformIO
#+begin_src vimrc
Plug 'anurag3301/nvim-platformio.lua'
#+end_src
And dependencies
#+begin_src vimrc
Plug 'akinsho/toggleterm.nvim'
Plug 'nvim-telescope/telescope.nvim'
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope-ui-select.nvim'
Plug 'folke/which-key.nvim'
#+end_src
** Plug End
#+begin_src vimrc
call plug#end()
@@ -144,8 +139,6 @@ call plug#end()
* Basic
** General
#+begin_src vimrc
set runtimepath+=~/.vim
" Sets how many lines of history VIM has to remember
set history=500
@@ -443,7 +436,7 @@ set guioptions-=L
** Turn persistent undo on
#+begin_src vimrc
try
set undodir=~/.vim_runtime/temp_dirs/undodir
set undodir=~/.local/share/nvim/undodir
set undofile
catch
endtry
@@ -662,8 +655,8 @@ au FileType matlab nmap <buffer> <localleader>mw :SlimeSend0('workspace')<CR>
#+end_src
* Plugins Config
** Treesitter
#+begin_src vimrc
** =nvim-treesitter=
#+begin_src vimrc :tangle no
lua <<EOF
require'nvim-treesitter.configs'.setup {
highlight = {
@@ -674,97 +667,7 @@ require'nvim-treesitter.configs'.setup {
EOF
#+end_src
** =junegunn/fzf=
#+begin_src vimrc
" " This is the default extra key bindings
" let g:fzf_action = {
" \ 'ctrl-t': 'tab split',
" \ 'ctrl-h': 'split',
" \ 'ctrl-v': 'vsplit' }
" " [[B]Commits] Customize the options used by 'git log':
" let g:fzf_commits_log_options = '--graph --color=always --format="%C(auto)%h%d %s %C(black)%C(bold)%cr"'
" let g:fzf_colors =
" \ { 'fg': ['fg', 'Normal'],
" \ 'bg': ['bg', 'Normal'],
" \ 'hl': ['fg', 'Comment'],
" \ 'fg+': ['fg', 'CursorLine', 'CursorColumn', 'Normal'],
" \ 'bg+': ['bg', 'CursorLine', 'CursorColumn'],
" \ 'hl+': ['fg', 'Statement'],
" \ 'info': ['fg', 'PreProc'],
" \ 'prompt': ['fg', 'Conditional'],
" \ 'pointer': ['fg', 'Exception'],
" \ 'marker': ['fg', 'Keyword'],
" \ 'spinner': ['fg', 'Label'],
" \ 'header': ['fg', 'Comment'] }
" function! s:fzf_statusline()
" " Override statusline as you like
" highlight fzf1 ctermfg=161 ctermbg=251
" highlight fzf2 ctermfg=23 ctermbg=251
" highlight fzf3 ctermfg=237 ctermbg=251
" setlocal statusline=%#fzf1#\ >\ %#fzf2#fz%#fzf3#f
" endfunction
" autocmd! User FzfStatusLine call <SID>fzf_statusline()
#+end_src
** =autozimu/LanguageClient-neovim=
#+begin_src vimrc
" let g:LanguageClient_serverCommands = {
" \ 'matlab': ['java', ' -Djava.library.path=$MATLABROOT/bin/glnxa64 -cp $MATLABROOT/extern/engines/java/jar/engine.jar:$MATLABROOT/java/jar/jmi.jar:/home/thomas/github/matlab-langserver/build/libs/lsp-matlab-0.1.jar org.tokor.lspmatlab.Application'],
" \ }
" nnoremap <F5> :call LanguageClient_contextMenu()<CR>
" " Or map each action separately
" nnoremap <silent> K :call LanguageClient#textDocument_hover()<CR>
" nnoremap <silent> gd :call LanguageClient#textDocument_definition()<CR>
" nnoremap <silent> <F2> :call LanguageClient#textDocument_rename()<CR>
#+end_src
** =JamshedVesuna/vim-markdown-preview=
#+begin_src vimrc
" let vim_markdown_preview_github=1
" let vim_markdown_preview_browser='Google Chrome'
" let vim_markdown_preview_temp_file=1
" let vim_markdown_preview_pandoc=1
#+end_src
** =mhinz/vim-signify=
#+begin_src vimrc
let g:signify_vcs_list = ['git']
let g:signify_disable_by_default = 1
#+end_src
** =Deoplete=
#+begin_src vimrc
" let g:deoplete#enable_at_startup = 1
" let g:deoplete#omni#functions = {}
" set completeopt=longest,menuone,preview
" let g:deoplete#sources = {}
" let g:deoplete#enable_smart_case = 1
" call deoplete#custom#set('ultisnips', 'matchers', ['matcher_fuzzy'])
#+end_src
** =SirVer/ultisnips=
#+begin_src vimrc
" let g:UltiSnipsSnippetsDir = '~/.vim/UltiSnip'
" " inoremap <silent><expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
" let g:UltiSnipsExpandTrigger="<C-j>"
" let g:UltiSnipsJumpForwardTrigger="<tab>"
" let g:UltiSnipsJumpBackwardTrigger="<s-tab>"
#+end_src
** =honza/vim-snippets=
#+begin_src vimrc
let g:snipMate = {}
let g:snipMate.scope_aliases = {}
#+end_src
** =itchyny/lightline.vim=
** =lightline=
#+begin_src vimrc
" \ 'colorscheme': 'gruvbox',
let g:lightline = {
@@ -784,7 +687,7 @@ let g:lightline = {
\ }
#+end_src
** Git
** =neogit=
#+begin_src vimrc
lua <<EOF
local neogit = require('neogit')
@@ -793,8 +696,8 @@ neogit.setup {}
EOF
#+end_src
** LSP
#+begin_src vimrc
** =lsp-zero=
#+begin_src vimrc :tangle no
lua <<EOF
local lsp = require('lsp-zero')
@@ -803,25 +706,25 @@ lsp.setup()
EOF
#+end_src
** =Autopairs=
** =autopairs=
#+begin_src vimrc
" Incompatibilité entre auto-pairs et clang-complete
let g:AutoPairsMapCR = 0
imap <silent><CR> <CR><Plug>AutoPairsReturn
#+end_src
** =Yggdroot/indentLine=
** =indentLine=
#+begin_src vimrc
" :IndentLinesToggle toggles lines on and off.
let g:indentLine_color_term = 239
#+end_src
** =ryanoasis/vim-devicons=
** =vim-devicons=
#+begin_src vimrc
let g:webdevicons_enable_ctrlp = 1
#+end_src
** =tpope/vim-surround=
** =vim-surround=
#+begin_src vimrc
vmap Si S(i_<esc>f)
au FileType mako vmap Si S"i${ _(<esc>2f"a) }<esc>
@@ -829,43 +732,14 @@ au FileType mako vmap Si S"i${ _(<esc>2f"a) }<esc>
let g:surround_{char2nr('b')} = "__\r__"
#+end_src
** =Neomake=
#+begin_src vimrc
" " Latex
" autocmd! BufWritePost *.tex Neomake
" let g:neomake_tex_chktex_maker = {
" \ 'exe': 'chktex',
" \ 'args': ['--inputfiles'],
" \ 'errorformat':
" \ '%EError %n in %f line %l: %m,' .
" \ '%WWarning %n in %f line %l: %m,' .
" \ '%WMessage %n in %f line %l: %m,' .
" \ '%Z%p^,' .
" \ '%-G%.%#'
" \ }
" let g:neomake_tex_enabled_makers = ['chktex']
" " Matlab
" autocmd! BufWritePost *.m Neomake
" let g:neomake_matlab_mlint_maker = {
" \ 'exe': 'mlint',
" \ 'mapexpr': "neomake_bufname.':'.v:val",
" \ 'errorformat':
" \ '%f:L %l (C %c): %m,' .
" \ '%f:L %l (C %c-%*[0-9]): %m,',
" \ }
" let g:neomake_matlab_enabled_makers = ['mlint']
** =vimtex=
#+begin_src vimrc :tangle no
let g:tex_conceal=""
autocmd FileType tex let b:vimtex_main = 'main.tex'
let g:vimtex_mappings_enabled=0
#+end_src
** =lervag/vimtex=
#+begin_src vimrc
" let g:tex_conceal=""
" autocmd FileType tex let b:vimtex_main = 'main.tex'
" let g:vimtex_mappings_enabled=0
#+end_src
** =jpalardy/vim-slime=
** =vim-slime=
#+begin_src vimrc
if exists('$TMUX')
let g:slime_target = "tmux"
@@ -874,26 +748,46 @@ if exists('$TMUX')
endif
#+end_src
** =mhinz/vim-grepper=
#+begin_src vimrc
" nnoremap <leader>G :Grepper -tool ag<cr>
" nmap gs <plug>(GrepperOperator)
" xmap gs <plug>(GrepperOperator)
** =vim-grepper=
#+begin_src vimrc :tangle no
nnoremap <leader>G :Grepper -tool ag<cr>
nmap gs <plug>(GrepperOperator)
xmap gs <plug>(GrepperOperator)
#+end_src
** Editor config
#+begin_src vimrc
" To ensure that this plugin works well with Tim Pope's fugitive, use the following patterns array:
let g:EditorConfig_exclude_patterns = ['fugitive://.*']
#+end_src
** Telescope
** =telescope=
#+begin_src vimrc
lua <<EOF
require('telescope').load_extension('fzf')
EOF
#+end_src
** =platformIO=
#+begin_src vimrc
lua << EOF
local ok, platformio = pcall(require, 'platformio')
if ok then
platformio.setup({
lsp = 'ccls', -- or whichever LSP you want
menu_key = '<leader>\\', -- default, you can change
menu_name = 'PlatformIO',
menu_bindings = {
{ node = 'item', desc = '[L]ist terminals', shortcut = 'l', command = 'PioTermList' },
{ node = 'item', desc = '[T]erminal Core CLI', shortcut = 't', command = 'Piocmdf' },
{ node = 'menu', desc = '[G]eneral', shortcut = 'g', items = {
{ node = 'item', desc = '[B]uild', shortcut = 'b', command = 'Piocmdf run' },
{ node = 'item', desc = '[U]pload', shortcut = 'u', command = 'Piocmdf run -t upload' },
{ node = 'item', desc = '[M]onitor', shortcut = 'm', command = 'Piocmdh run -t monitor'},
{ node = 'item', desc = '[C]lean', shortcut = 'c', command = 'Piocmdf run -t clean' },
{ node = 'item', desc = '[F]ull clean', shortcut = 'f', command = 'Piocmdf run -t fullclean' },
{ node = 'item', desc = '[D]evice list', shortcut = 'd', command = 'Piocmdf device list' },
}},
},
})
end
EOF
#+end_src
* Key Bindings
** Quit
#+begin_src vimrc

View File

@@ -23,7 +23,7 @@ Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManage
Then, install all required software using one command:
#+begin_src bash
choco install -y firefox 7zip.install vlc git.install malwarebytes sumatrapdf.install steam anydesk discord f.lux cmder cura ccleaner neovim imageglass
choco install -y firefox 7zip.install vlc git.install malwarebytes sumatrapdf.install steam anydesk discord f.lux cmder cura ccleaner neovim imageglass mobaxterm
#+end_src
* Debloat windows10

View File

@@ -60,32 +60,51 @@ Xft.rgba: rgb
** Cursor
#+BEGIN_SRC conf
Xcursor.theme: Breeze
Xcursor.size: 0
Xcursor.size: 24
#+END_SRC
* =~/.xinitrc=
** SXIV
#+BEGIN_SRC css
Nsxiv.window.background: #FFFFFF
Nsxiv.window.foreground: #d5c4a1
Nsxiv.bar.font: Hack-10
Nsxiv.bar.background: #fbf1c7
Nsxiv.bar.foreground: #32302f
#+END_SRC
* =xinitrc=
:PROPERTIES:
:header-args: :tangle ~/.xinitrc
:header-args: :tangle ~/.config/X11/xinitrc
:header-args+: :comments both :mkdirp yes
:header-args+: :shebang "#!/bin/sh"
:CUSTOM_ID: xinitrc
:END:
Use the cache directory instead of the default =$HOME/.xsession-errors=.
#+begin_src bash
dbus-update-activation-environment --systemd DISPLAY
#+end_src
Fix for Matlab.
#+begin_src bash
# export _JAVA_AWT_WM_NONREPARENTING=1
ERRFILE="$XDG_CACHE_HOME/X11/xsession-errors"
#+end_src
Set =DISPLAY= for =dunst= when started with =systemd=.
#+begin_src bash
# systemctl --user import-environment DISPLAY
systemctl --user import-environment DISPLAY
#+end_src
Merge in defaults and keymaps
Run some default scripts:
#+begin_src bash
if [ -d /etc/X11/xinit/xinitrc.d ] ; then
for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
[ -x "$f" ] && . "$f"
done
unset f
fi
#+end_src
#+begin_src bash
[ -f ~/.xprofile ] && . ~/.xprofile
#+end_src
Merge the defaults:
#+BEGIN_SRC bash
userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
@@ -109,16 +128,6 @@ if [ -f "$usermodmap" ]; then
fi
#+END_SRC
Start =gnome-keyring-daemon=.
#+begin_src bash
eval $(gnome-keyring-daemon --start --components=pkcs11,secrets,ssh)
export SSH_AUTH_SOCK
#+end_src
#+begin_src bash
[ -f ~/.xprofile ] && . ~/.xprofile
#+end_src
#+begin_src bash
exec i3
#+end_src
@@ -133,9 +142,6 @@ exec i3
Keyboard Options:
#+begin_src bash
# Set repetition keyboard rate
xset r rate 200 40 &
# Set International US keyboard layout
setxkbmap -layout us -variant intl -option caps:escape &
#+end_src
@@ -157,19 +163,28 @@ xautolock -locker "~/.local/bin/lockscreen" -detectsleep -time 30 -notify 60 -no
# Redshift
pgrep -xu "$USER" redshift >/dev/null || \
redshift &
redshift -l 48.8582:2.3387 &
# Run Picom (compositor)
picom --daemon &
# Network Manager Applet
nm-applet &
# Bluetooh Applet
blueman-applet &
# Udiskie - Automatic USB mount
udiskie --notify --automount --tray &
# Japanese input
# fcitx -d &
#+end_src
Manually start =mopidy= as it seems to not start automatically:
#+begin_src bash
# Mopidy
/usr/local/bin/mopidy --config ~/.config/mopidy/mopidy.conf >/dev/null 2>&1 &
~/.local/soft/mopidy-jellyfin/env/bin/mopidy >/tmp/mopidy.log 2>&1 &
#+end_src
Finally, run SXHKD for the key bindings:

208
yazi.org Normal file
View File

@@ -0,0 +1,208 @@
#+TITLE: Yazi
#+SETUPFILE: ./setup/org-setup-file.org
* General configuration
#+begin_src conf :tangle ~/.config/yazi/yazi.toml
[preview]
tab_size = 4
image_filter = "nearest"
[opener]
onlyoffice = [
{ run = "onlyoffice-desktopeditors %s", block = false, desc = "Only-Office"},
]
nsxiv = [
{ run = "nsxiv %s", block = false, desc = "nsxiv"},
]
f3d = [
{ run = "f3d %s", block = false, desc = "F3D"},
]
inkscape = [
{ run = "inkscape %s", block = false, desc = "Inkscape"},
]
emacs = [
{ run = "emacsclient -c %s", block = false, desc = "Emacs"},
]
nvim = [
{ run = "nvim %s", block = true, desc = "neovim"},
]
freecad = [
{ run = "freecad %s", block = false, desc = "FreeCAD"},
]
qutebrowser = [
{ run = "qutebrowser %s", block = false, desc = "Qutebrowser"},
]
ics-add = [
{ run = "ics-add %s", block = false, desc = "Add ICS"},
]
xournal = [
{ run = "xournalpp %s", block = false, desc = "Xournalpp"},
]
[open]
prepend_rules = [
{ url="*.step", use = "f3d" },
{ url = "*.org", use = ["emacs", "nvim"] },
{ mime = "text/plain", use = "nvim" },
{ mime = "image/bmp", use = ["nsxiv", "inkscape"] },
{ mime = "text/xml", use = "qutebrowser" },
{ mime = "text/calendar", use = "ics-add" },
{ mime = "application/pdf", use = ["open", "inkscape", "xournal"] },
{ mime = "application/zip", url = "*.FCStd", use = "freecad" },
{ mime = "application/zip", url = "*.3mf", use = "f3d" },
{ mime = "application/octet-stream", url = "*.stl", use = "f3d" },
{ mime = "application/octet-stream", url = "*.stp", use = "f3d" },
{ mime = "application/vnd.openxmlformats-officedocument.wordprocessingml.document", use = "onlyoffice" },
]
#+end_src
* Keybindings configuration
#+begin_src conf :tangle ~/.config/yazi/keymap.toml
[[mgr.prepend_keymap]]
on = [ "g", "w" ]
run = "cd ~/Cloud/work-projects"
desc = "Cd to work-projects"
[[mgr.prepend_keymap]]
on = [ "g", "p" ]
run = "cd ~/Cloud/personnal"
desc = "Cd to personnal"
[[mgr.prepend_keymap]]
on = [ "g", "P" ]
run = "cd ~/Cloud/pictures/phone"
desc = "Cd to pictures"
[[mgr.prepend_keymap]]
on = [ "g", "s" ]
run = "cd ~/Cloud/pictures/screenshots"
desc = "Cd to screenshots"
[[mgr.prepend_keymap]]
on = [ "g", "T" ]
run = "cd ~/.local/share/Trash/files"
desc = "Cd to trash"
[[mgr.prepend_keymap]]
on = [ "g", "m" ]
run = "cd ~/Cloud/meetings"
desc = "Cd to meetings"
[[mgr.prepend_keymap]]
on = [ "g", "D" ]
run = "cd ~/Cloud/documents"
desc = "Cd to documents"
[[mgr.prepend_keymap]]
on = "R"
run = "rename --empty=stem --cursor=start"
desc = "rename overwrite"
[[mgr.prepend_keymap]]
on = "q"
run = "shell 'if [ -n \"$TMUX\" ]; then tmux detach; fi' --confirm"
desc = "Quit Yazi"
[[mgr.prepend_keymap]]
on = "!"
run = 'shell "$SHELL" --block --confirm'
desc = "Open shell here"
[[mgr.prepend_keymap]]
on = "<C-n>"
run = '''
shell 'dragon-drop -a -x "$@"' --confirm
'''
#+end_src
#+begin_src conf :tangle ~/.config/yazi/keymap.toml
[[mgr.prepend_keymap]]
on = ["e", "o"]
run = 'shell "nohup pcmanfm $(dirname \"$0\") &" --confirm'
desc = "Open directory"
[[mgr.prepend_keymap]]
on = ["e", "x"]
run = 'shell "~/.config/yazi/scripts/extract.sh \"$0\"" --confirm'
desc = "Extract"
[[mgr.prepend_keymap]]
on = ["e", "z"]
run = 'shell "~/.config/yazi/scripts/compress.sh \"$(basename $0)\"" --confirm'
desc = "Compress"
[[mgr.prepend_keymap]]
on = ["e", "e"]
run = 'shell "convert-file \"$0\"" --confirm'
desc = "Convert File"
[[mgr.prepend_keymap]]
on = ["e", "b"]
run = 'shell "~/.config/yazi/scripts/add-reference.sh \"$0\"" --confirm'
desc = "Convert File"
[[mgr.prepend_keymap]]
on = ["e", "p"]
run = 'shell "print-esrf \"$0\"" --confirm'
desc = "Print"
#+end_src
* Color scheme configuration.
#+begin_src conf :tangle ~/.config/yazi/theme.toml
#+end_src
* Scripts
*** Extract DOI, create BibTeX and rename file
:PROPERTIES:
:header-args: :tangle ~/.config/yazi/scripts/add-reference.sh
:header-args+: :comments both :mkdirp yes
:header-args+: :shebang "#!/usr/bin/env bash"
:END:
#+begin_src bash
add_reference () {
doi=$(pdf2doi $1 | sed 's/^DOI *//' | sed 's/ \+.*//')
# If empty DOI, ask manually
if [ -z $doi ]; then
doi=$(rofi -dmenu -p "DOI")
fi
# If DOI, add it to Emacs
if [ ! -z $doi ]; then
emacsclient --eval "(tdh-org-ref-import-pdf \"$doi\" \"$1\")" && \
dunstify --replace=49496 "BibTeX" "File copied."
else
dunstify --replace=49496 "BibTeX" "Failed to get DOI"
fi
}
add_reference "$1"
#+end_src
*** Extract Script
:PROPERTIES:
:header-args: :tangle ~/.config/yazi/scripts/extract.sh
:header-args+: :comments both :mkdirp yes
:header-args+: :shebang "#!/usr/bin/env bash"
:END:
#+begin_src bash
if [ $TMUX ]; then
tmux split -v -l 2 atool -x "$1" && tmux select-pane -U
else
atool -x "$1"
fi
#+end_src
*** Compress Script
:PROPERTIES:
:header-args: :tangle ~/.config/yazi/scripts/compress.sh
:header-args+: :comments both :mkdirp yes
:header-args+: :shebang "#!/usr/bin/env bash"
:END:
#+begin_src bash
if [ $TMUX ]; then
tmux split -v -l 2 apack "${1%.*}.zip" "$1" && tmux select-pane -U
else
apack "${1%.*}.zip" "$1"
fi
#+end_src

View File

@@ -42,7 +42,8 @@ map t toggle_statusbar
map <Space> scroll full-down
map <BackSpace> scroll full-up
map <C-s> feedkeys ":exec /home/thomas/.config/zathura/scripts/extract-pdf-page.sh $FILE<Return>"
map <C-s> feedkeys ":exec /home/thomas/.config/zathura/scripts/extract-pdf-page.sh $FILE $PAGE<Return>"
map P feedkeys ":exec /home/thomas/.local/bin/print-esrf $FILE<Return>"
#+END_SRC
* Colors
@@ -96,9 +97,9 @@ tmpfile=/tmp/pdf_page.pdf
# Ask for page number
# Ideally would get the page from Zathura...
pagenum=$(rofi -dmenu -p "Page Number")
# pagenum=$(rofi -dmenu -p "Page Number")
pdftk "$1" cat $pagenum output "$tmpfile.pdf" && \
pdftk "$1" cat $2 output "$tmpfile.pdf" && \
pdf2svg "$tmpfile.pdf" "$tmpfile.svg" && \
inkscape "$tmpfile.svg"
#+end_src