Browse Source

scripts added

master
Juni Kim 2 years ago
parent
commit
7faa2c4340
  1. 2
      install_fedora.sh
  2. 2
      install_ubuntu.sh
  3. 7
      scripts/doc2pdf
  4. 3
      scripts/gpl
  5. 27
      scripts/tmuxs

2
install_fedora.sh

@ -63,6 +63,8 @@ dotfiles() {
fi
cp "$DIR/dots/zshrc" "$HOME/.zshrc"
cp "$DIR/dots/tmux.conf" "$HOME/.tmux.conf"
mkdir -p "$HOME/.local/bin" || exit 1
cp -r "$DIR/scripts" "$HOME/.local/bin" || exit 1
}
neovim() {

2
install_ubuntu.sh

@ -93,6 +93,8 @@ dotfiles() {
fi
cp "$DIR/dots/zshrc" "$HOME/.zshrc"
cp "$DIR/dots/tmux.conf" "$HOME/.tmux.conf"
mkdir -p "$HOME/.local/bin" || exit 1
cp -r "$DIR/scripts" "$HOME/.local/bin" || exit 1
}
neovim() {

7
scripts/doc2pdf

@ -0,0 +1,7 @@
#!/bin/sh
if [ -f "$1" ]; then
libreoffice --headless --convert-to pdf "$1" && rm -rf "$1"
else
echo "$1 is not a file." && exit 1
fi

3
scripts/gpl

@ -0,0 +1,3 @@
#!/bin/sh
curl -LJ https://www.gnu.org/licenses/gpl-3.0.md -o LICENSE.md

27
scripts/tmuxs

@ -0,0 +1,27 @@
#!/usr/bin/env sh
WORKSPACES=${WORKSPACES:-$HOME/Documents}
IFS=':' findargs=$WORKSPACES
if test -z "$1"; then
sessiondir="$(find $findargs -maxdepth 2 -type d 2>/dev/null | fzf)"
else
sessiondir="$1"
fi
if test -z "$sessiondir" || ! test -d "$sessiondir"; then
echo "$sessiondir is not a directory. Aborting..."
exit 0
fi
name="$(basename "$(realpath "$sessiondir" )" | tr '.' '_')"
if test -z "$TMUX" && test -z "$(pgrep tmux)"; then
tmux new-session -c "$sessiondir" -s "$name"
else
if ! tmux has-session -t="$name" 2> /dev/null; then
tmux new-session -d -c "$sessiondir" -s "$name"
fi
tmux switch-client -t "$name"
fi
Loading…
Cancel
Save