From 7f893cb7b502e4e24b88d124504a3978cec04d3b Mon Sep 17 00:00:00 2001 From: Yaroslav Date: Wed, 26 Feb 2020 22:22:39 +0300 Subject: added little to print wdiff output to pdf; updated install script --- dotfiles/.local/bin/wdifftopdf | 24 ++++++++++++++++++++++++ install.sh | 7 +++++-- 2 files changed, 29 insertions(+), 2 deletions(-) create mode 100755 dotfiles/.local/bin/wdifftopdf diff --git a/dotfiles/.local/bin/wdifftopdf b/dotfiles/.local/bin/wdifftopdf new file mode 100755 index 0000000..d44b920 --- /dev/null +++ b/dotfiles/.local/bin/wdifftopdf @@ -0,0 +1,24 @@ +#!/bin/sh + +# Little dirty script to print wdiff's output to a pdf file using pandoc and latex + +title="wdiff to pdf" + +if [ -z "$1" ] || [ -z "$2" ]; then + echo "Please specify two files to wdiff" + exit +fi + +if [ ! -z "$3" ]; then + title="$3" +fi + +body="$(wdiff "$1" "$2" | sed 's/\[-/\\sout{\\textcolor[rgb]{0.5,0,0}{/g;s/-\]/}}/g;s/{+/\\textcolor[rgb]{0,0.64,0.1}{/g;s/+}/}/g')" + +file=$(readlink -f "$1") +pandocfile="${file%.*}.md" +resultfile="${file%.*}.pdf" + +printf -- "---\ntitle: %s\noutput: pdf_document\nheader-includes:\n \\\\usepackage{ulem}\n \\\\usepackage[margin=3cm]{geometry}\n---\n\n%s" "$title" "$body" > "$pandocfile" + +pandoc "$pandocfile" -o "$resultfile" diff --git a/install.sh b/install.sh index 6c43abc..b2b89d0 100755 --- a/install.sh +++ b/install.sh @@ -1,5 +1,8 @@ #!/bin/sh +# Helper script to install some programs and configs for an Arch+Sway system +# Needs (quite some) work + if [ -z "$1" ]; then echo "Specify username for new user" fi @@ -7,7 +10,7 @@ fi CLONEDIR=$PWD # Install some basic programs -pacman -Sy --noconfirm base-devel zsh man networkmanager openvpn neovim sway swaylock swayidle waybar egl-wayland imv swaybg xorg-server-xwayland termite kitty qt5-wayland wl-clipboard dbus tmux htop bemenu mupdf mpd ncmpcpp mpc mpv mplayer libnotify mako cronie rsync grim slop ffmpeg w3m youtube-dl youtube-viewer newsboat wget curl krita inkscape darktable gcc make fontconfig pkg-config fakeroot papirus-icon-theme alsa-utils pulseaudio pulseaudio-bluetooth imagemagick ntfs-3g unzip unrar gnome-themes-standard gtk-engine-murrine telegram-desktop qt5ct r udisks2 perl-term-readline-gnu transmission-cli python-pynvim python-pip calcurse acpi acpid gnupg noto-fonts-cjk powerline-fonts python-pygit2 polkit polkit-gnome zathura zathura-pdf-mupdf zathura-djvu gst-libav vifm blueman bluez acpilight powertop accountsservice lightdm xdg-user-dirs abook ranger terminus-font qutebrowser jq stow +pacman -Sy --noconfirm base-devel zsh man networkmanager openvpn neovim sway swaylock swayidle waybar egl-wayland imv swaybg xorg-server-xwayland termite kitty qt5-wayland wl-clipboard dbus tmux htop bemenu mupdf mpd ncmpcpp mpc mpv mplayer libnotify mako cronie rsync grim slop ffmpeg w3m youtube-dl youtube-viewer newsboat wget curl krita inkscape darktable gcc make fontconfig pkg-config fakeroot papirus-icon-theme alsa-utils pulseaudio pulseaudio-bluetooth imagemagick ntfs-3g unzip unrar gnome-themes-standard gtk-engine-murrine telegram-desktop qt5ct r udisks2 perl-term-readline-gnu transmission-cli python-pynvim python-pip calcurse acpi acpid gnupg noto-fonts-cjk powerline-fonts python-pygit2 polkit polkit-gnome zathura zathura-pdf-mupdf zathura-djvu gst-libav vifm blueman bluez acpilight powertop accountsservice lightdm xdg-user-dirs abook ranger terminus-font qutebrowser jq stow wdiff texlive-most pandoc # Copy system config files cp system/sudoers /etc/ @@ -34,7 +37,7 @@ chown -R "$1:$1" build cd build sudo -u "$1" "git clone https://aur.archlinux.org/yay.git && cd yay && makepkg -si" -yay -S --noconfirm ttf-symbola stig pam-gnupg mutt-wizard-git ncpamixer lightdm-mini-greeter plymouth-git mimeo xdg-utils-mimeo cli-visualizer +yay -S --noconfirm ttf-symbola stig pam-gnupg mutt-wizard-git ncpamixer lightdm-mini-greeter plymouth-git mimeo xdg-utils-mimeo cli-visualizer transgui-gtk cd "$CLONEDIR" -- cgit v1.2.3