Compare commits

...

6 Commits

Author SHA1 Message Date
tdehaeze 38e8ea43cd Improvements when installing the new machine 2026-04-15 13:35:39 +02:00
tdehaeze d11455427c hostnamectl instead of hostname 2026-04-15 13:11:59 +02:00
tdehaeze 05da66e888 Remove some gtk installation 2026-04-15 11:45:34 +02:00
tdehaeze 452ce78c46 Move from pdftk to qpdf
Remove dependency on java
2026-04-15 11:39:19 +02:00
tdehaeze 579d141d93 neofetch => fastfetch 2026-04-15 11:12:45 +02:00
tdehaeze 855902bd61 Update install script 2026-04-15 11:11:02 +02:00
8 changed files with 45 additions and 71 deletions
+6 -4
View File
@@ -238,13 +238,15 @@ export TEXMFHOME=$HOME/.local/share/texmf
*** Linkding
#+begin_src bash
export LINKDING_URL=`pass nas/linkding_url`
export LINKDING_TOKEN=`pass nas/linkding_token`
if [ "$(hostnamectl hostname)" = "ldehaeze" ]; then
export LINKDING_URL=`pass nas/linkding_url`
export LINKDING_TOKEN=`pass nas/linkding_token`
fi
#+end_src
*** Restic
#+begin_src bash
if [ "$(hostname)" = "ldehaeze" ]; then
if [ "$(hostnamectl hostname)" = "ldehaeze" ]; then
export RESTIC_REPOSITORY=sftp:thomas@homelab:/srv/storage/Backups/esrf-laptop
export RESTIC_PASSWORD_COMMAND="pass show restic"
fi
@@ -258,7 +260,7 @@ export PATH
** Automatically run =startx=
#+begin_src bash
if [ -z "${DISPLAY}" ] && [ "${XDG_VTNR}" -eq 1 ]; then
if [ -z "${DISPLAY}" ] && [ -n "${XDG_VTNR}" ] && [ "${XDG_VTNR}" -eq 1 ]; then
exec startx
fi
#+end_src
+14 -14
View File
@@ -378,7 +378,7 @@ List of useful programs:
- =inkscape=
- =gs=
- =pdfcrop=
- =pdftk=
- =qpdf=
*** PDF to PNG
#+begin_src bash
@@ -439,7 +439,7 @@ pdftrim_function() { \
*** PDF Extract Pages
#+begin_src bash
pdfextract_function() { \
if command -v pdftk &> /dev/null; then
if command -v qpdf &> /dev/null; then
pages=$(echo -e "get first\ndelete first\nextract i-j" | rofi -i -dmenu -p "Extract pages")
if [ -z "$pages" ]; then
@@ -448,21 +448,21 @@ pdfextract_function() { \
case "$pages" in
"get first")
if command -v pdftk &> /dev/null; then
pdftk "$filename_with_extension" cat 1-1 output "$filename_without_extension.first.pdf"
if command -v qpdf &> /dev/null; then
qpdf --pages "$filename_with_extension" 1 -- "$filename_with_extension" "$filename_without_extension.first.pdf"
fi
;;
"delete first")
if command -v pdftk &> /dev/null; then
pdftk "$filename_with_extension" cat 2-end output "$filename_with_extension"
if command -v qpdf &> /dev/null; then
qpdf --pages "$filename_with_extension" 2-z -- "$filename_with_extension" "$filename_with_extension"
fi
;;
"extract i-j")
# TODO
page_i=$(rofi -dmenu -p "From")
page_j=$(rofi -dmenu -p "To")
if command -v pdftk &> /dev/null; then
pdftk "$filename_with_extension" cat "$page_i-$page_j" output "$filename_with_extension.slice.pdf"
if command -v qpdf &> /dev/null; then
qpdf --pages "$filename_with_extension" "$page_i-$page_j" -- "$filename_with_extension" "$filename_with_extension.slice.pdf"
fi
;;
esac
@@ -474,9 +474,9 @@ pdfextract_function() { \
#+begin_src bash
pdf_delete_first_page_function() { \
if command -v stapler &> /dev/null; then
stapler del "$filename_with_extension" 1 /tmp/pdftk_out.pdf && mv /tmp/pdftk_out.pdf "$filename_with_extension"
elif command -v pdftk &> /dev/null; then
pdftk "$filename_with_extension" cat 2-end output /tmp/pdftk_out.pdf && mv /tmp/pdftk_out.pdf "$filename_with_extension"
stapler del "$filename_with_extension" 1 /tmp/qpdf_out.pdf && mv /tmp/qpdf_out.pdf "$filename_with_extension"
elif command -v qpdf &> /dev/null; then
qpdf --pages "$filename_with_extension" 2-z -- "$filename_with_extension" /tmp/qpdf_out.pdf && mv /tmp/qpdf_out.pdf "$filename_with_extension"
fi
}
#+end_src
@@ -484,10 +484,10 @@ pdf_delete_first_page_function() { \
*** Remove Annotations
#+begin_src bash
pdf_remove_annotations_function() { \
if command -v pdftk &> /dev/null; then
pdftk "$filename_with_extension" output /tmp/uncompressed.pdf uncompress
if command -v qpdf &> /dev/null; then
qpdf --qdf "$filename_with_extension" /tmp/uncompressed.pdf
LANG=C sed -n '/^\/Annots/!p' /tmp/uncompressed.pdf > /tmp/stripped.pdf
pdftk /tmp/stripped.pdf output "$filename_with_extension" compress
qpdf /tmp/stripped.pdf "$filename_with_extension"
fi
}
#+end_src
+8 -15
View File
@@ -33,29 +33,22 @@ echo "==> Emacs packages"
paru -S --needed emacs aspell aspell-en aspell-fr
#+end_src
** Doom Emacs
#+begin_src bash
echo "==> Installing Doom Emacs"
git clone --depth 1 https://github.com/doomemacs/doomemacs ~/.config/emacs
"${DOOM}" install --no-config
#+end_src
** Tangle Configuration
Tangle =doom.org= to generate =config.el=, =init.el= and =packages.el=:
#+begin_src bash
echo "==> Tangling doom.org"
emacsclient -e "(org-babel-tangle-file \"${DOTFILES}/doom.org\")" \
|| emacs --batch -l org --eval "(org-babel-tangle-file \"${DOTFILES}/doom.org\")"
mkdir ${HOME}/.config/doom
emacs --batch -l org --eval "(org-babel-tangle-file \"${DOTFILES}/doom.org\")"
#+end_src
** Sync
** Doom Install
#+begin_src bash
echo "==> Running doom sync"
"${DOOM}" sync
echo "==> Installing Doom Emacs"
git clone --depth 1 https://github.com/doomemacs/doomemacs ~/.config/emacs
"${DOOM}" install
#+end_src
* Introduction and Resources
@@ -360,7 +353,7 @@ Function that opens current pdf page as an SVG file with Inkscape.
(setq filename (read-string "Enter file name:" (car (split-string (file-name-base buffer-file-name) "_"))))
(setq filename (read-string "Enter file name:")))
(setq filepath (concat "/tmp/" filename ".svg"))
(shell-command (concat "pdftk " buffer-file-name " cat " (number-to-string (pdf-view-current-page)) " output /tmp/pdf_page.pdf"))
(shell-command (concat "qpdf --pages " buffer-file-name " " (number-to-string (pdf-view-current-page)) " -- " buffer-file-name " /tmp/pdf_page.pdf"))
(shell-command (concat "pdf2svg /tmp/pdf_page.pdf " filepath))
(start-process "" nil "inkscape" filepath))
@@ -3210,7 +3203,7 @@ Provides nice functions such as:
;;nim ; python + lisp at the speed of c
;;nix ; I hereby declare "nix geht mehr!"
;;ocaml ; an objective camel
(org +pretty +roam2 +hugo +noter) ; organize your plain life in plain text
(org +pretty +roam +hugo +noter) ; organize your plain life in plain text
;;php ; perl's insecure younger brother
;;plantuml ; diagrams for confusing people more
;;graphviz ; diagrams for confusing yourself even more
+7 -19
View File
@@ -50,8 +50,7 @@ set -euo pipefail
DOTFILES="${HOME}/.config/literate-dotfiles"
tangle() {
emacsclient -e "(org-babel-tangle-file \"${DOTFILES}/$1\")" \
|| emacs --batch -l org --eval "(org-babel-tangle-file \"${DOTFILES}/$1\")"
emacs --batch -l org --eval "(org-babel-tangle-file \"${DOTFILES}/$1\")"
}
#+end_src
@@ -69,10 +68,8 @@ paru -S --needed \
kitty \
bash bash-completion \
zoxide \
nerd-fonts-hack noto-fonts-emoji \
xorg-xrandr arandr \
xautocfg \
arc-gtk-theme xcursor-breeze \
feh xwallpaper
#+end_src
@@ -127,7 +124,9 @@ paru -S --needed \
#+begin_src bash
echo "==> Fonts"
paru -S --needed \
nerd-fonts-hack \
ttf-hack-nerd \
ttf-sourcecodepro-nerd \
adobe-source-code-pro-fonts \
noto-fonts-emoji
#+end_src
@@ -228,7 +227,7 @@ paru -S --needed \
atool unzip \
trash-cli \
man-db \
neofetch
fastfetch
#+end_src
** Browser
@@ -256,6 +255,7 @@ paru -S --needed \
mpv \
jellyfin-tui \
nsxiv \
tesseract tesseract-data-eng tesseract-data-fra tesseract-data-osd \
zathura zathura-pdf-mupdf zathura-djvu zathura-ps zathura-cb \
pdfpc \
gst-plugins-ugly gst-plugins-good gst-plugins-base-libs gst-plugins-base gst-plugins-bad gst-libav
@@ -283,7 +283,7 @@ systemctl --user enable --now wireplumber.service
#+begin_src bash
echo "==> PDF and Image Utilities"
paru -S --needed \
pdf2svg pdftk pdfarranger \
pdf2svg qpdf pdfarranger \
imagemagick \
maim flameshot \
unclutter \
@@ -327,23 +327,11 @@ Enable Syncthing:
systemctl --user enable --now syncthing
#+end_src
** GTK Theme
#+begin_src bash
echo "==> GTK Theme"
paru -S --needed \
lxappearance \
arc-gtk-theme \
xcursor-breeze \
gtk2fontsel
#+end_src
** Misc Utilities
#+begin_src bash
echo "==> Misc Utilities"
paru -S --needed \
screenkey \
xwallpaper \
highlight-pointer-git \
mpd
+1 -4
View File
@@ -4,8 +4,7 @@ set -euo pipefail
DOTFILES="${HOME}/.config/literate-dotfiles"
tangle() {
emacsclient -e "(org-babel-tangle-file \"${DOTFILES}/$1\")" \
|| emacs --batch -l org --eval "(org-babel-tangle-file \"${DOTFILES}/$1\")"
emacs --batch -l org --eval "(org-babel-tangle-file \"${DOTFILES}/$1\")"
}
echo "==> Desktop packages"
@@ -19,10 +18,8 @@ paru -S --needed \
kitty \
bash bash-completion \
zoxide \
nerd-fonts-hack noto-fonts-emoji \
xorg-xrandr arandr \
xautocfg \
arc-gtk-theme xcursor-breeze \
feh xwallpaper
echo "==> Tangling desktop configs"
+7 -12
View File
@@ -9,12 +9,14 @@ paru -S --needed \
echo "==> Fonts"
paru -S --needed \
nerd-fonts-hack \
ttf-hack-nerd \
ttf-sourcecodepro-nerd \
adobe-source-code-pro-fonts \
noto-fonts-emoji
echo "==> Text Editors"
paru -S --needed \
neovim python-pynvim \
neovim python-pynvim nodejs-neovim \
emacs \
aspell aspell-en aspell-fr
@@ -44,7 +46,7 @@ paru -S --needed \
atool unzip \
trash-cli \
man-db \
neofetch
fastfetch
echo "==> Browser"
paru -S --needed \
@@ -56,6 +58,7 @@ paru -S --needed \
mpv \
jellyfin-tui \
nsxiv \
tesseract tesseract-data-eng tesseract-data-fra tesseract-data-osd \
zathura zathura-pdf-mupdf zathura-djvu zathura-ps zathura-cb \
pdfpc \
gst-plugins-ugly gst-plugins-good gst-plugins-base-libs gst-plugins-base gst-plugins-bad gst-libav
@@ -68,7 +71,7 @@ paru -S --needed \
echo "==> PDF and Image Utilities"
paru -S --needed \
pdf2svg pdftk pdfarranger \
pdf2svg qpdf pdfarranger \
imagemagick \
maim flameshot \
unclutter \
@@ -98,16 +101,8 @@ paru -S --needed \
yt-dlp \
python ipython python-pip
echo "==> GTK Theme"
paru -S --needed \
lxappearance \
arc-gtk-theme \
xcursor-breeze \
gtk2fontsel
echo "==> Misc Utilities"
paru -S --needed \
screenkey \
xwallpaper \
highlight-pointer-git \
mpd
+1 -2
View File
@@ -36,8 +36,7 @@ Tangle =vim.org= to generate =~/.config/nvim/init.vim=:
#+begin_src bash
echo "==> Tangling vim.org"
emacsclient -e "(org-babel-tangle-file \"${DOTFILES}/vim.org\")" \
|| emacs --batch -l org --eval "(org-babel-tangle-file \"${DOTFILES}/vim.org\")"
emacs --batch -l org --eval "(org-babel-tangle-file \"${DOTFILES}/vim.org\")"
#+end_src
** Install Plugins
+1 -1
View File
@@ -99,7 +99,7 @@ tmpfile=/tmp/pdf_page.pdf
# Ideally would get the page from Zathura...
# pagenum=$(rofi -dmenu -p "Page Number")
pdftk "$1" cat $2 output "$tmpfile.pdf" && \
qpdf --pages "$1" "$2" -- "$1" "$tmpfile.pdf" && \
pdf2svg "$tmpfile.pdf" "$tmpfile.svg" && \
inkscape "$tmpfile.svg"
#+end_src