diff options
author | Guangxiong Lin <[email protected]> | 2022-01-08 13:34:14 +0800 |
---|---|---|
committer | Guangxiong Lin <[email protected]> | 2022-01-08 13:34:14 +0800 |
commit | 4a0982defbe2de8744b911a706a1ced92139ad7b (patch) | |
tree | 828510bf0c6b6b1fe120291118a5a82bde69a0d7 | |
parent | 1545291c6bdd0f83fbad092dc464aecd68498be8 (diff) | |
parent | c2100f3801d69e768e43259f279f2c66858b10fc (diff) | |
download | dotfiles-4a0982defbe2de8744b911a706a1ced92139ad7b.tar.gz dotfiles-4a0982defbe2de8744b911a706a1ced92139ad7b.tar.bz2 dotfiles-4a0982defbe2de8744b911a706a1ced92139ad7b.zip |
Merge remote-tracking branch 'origin/master'
-rw-r--r-- | .aliases | 2 | ||||
-rw-r--r-- | .functions | 17 |
2 files changed, 12 insertions, 7 deletions
@@ -7,8 +7,6 @@ alias nb='cd ~/journals; vim index.md; cd -' alias todo='cd ~/journals; vim gtd.md; cd -' alias vimg='vim +Git +only' -[ -f /usr/bin/xdg-open ] && alias open='xdg-open' - if [ -f /usr/bin/pacman ]; then alias S='pacman -S' alias Si='pacman -Si' @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + fco () { local tags branches target branches=$( @@ -15,11 +17,6 @@ fco () { git checkout $(awk '{print $2}' <<<$target) } -fjrnl () { - title=$(jrnl --short | fzf --tac --no-sort) \ - && jrnl -on $(echo $title | cut -c 1-16) $1 -} - fs () { local session session=$(tmux list-sessions -F "#{session_name}" \ @@ -34,3 +31,13 @@ tm() { fi session=$(tmux list-sessions -F "#{session_name}" 2>/dev/null | fzf --exit-0) && tmux $change -t "$session" || echo "No sessions found." } + +open () { + if [ -f /usr/bin/xdg-open ]; then + nohup xdg-open "$*" > /dev/null 2>&1 & + elif [ -f /usr/bin/open ]; then + /usr/bin/open "$*" + else + echo "No usable program is found" + fi +} |