aboutsummaryrefslogtreecommitdiff
path: root/shellrc
diff options
context:
space:
mode:
Diffstat (limited to 'shellrc')
-rw-r--r--shellrc47
1 files changed, 0 insertions, 47 deletions
diff --git a/shellrc b/shellrc
index a01b3e5..1deea54 100644
--- a/shellrc
+++ b/shellrc
@@ -52,53 +52,6 @@ genpasswd() {
tr -dc A-Za-z0-9_ < /dev/urandom | head -c "$l" | xargs
}
-# Clip stdin to clipboard
-clip() {
- # Note: printf as magic to remove trailing new lines
- printf %s "$(cat)" | xclip -selection clipboard
-}
-
-# Clip current HEAD hash to clipboard
-# Optionally you can pass commit as argument
-gitclip() {
- [ -n "$1" ] && local CMT="$1" || local CMT=HEAD
- git rev-parse "$CMT"| clip
-}
-# Clip current head message to clipboard
-# Optionally you can pass commit as argument
-gitmclip() {
- [ -n "$1" ] && local CMT="$1" || local CMT=HEAD
- git log --format=%B -n 1 "$CMT" | clip
-}
-
-# Automatic branch merger (merge branch, push it to server and remove branch)
-# Expects name of the branch as argument
-gitbmerge() {
- (
- set -e
- local WT="$(git worktree list | sed -nE "/\[$1\]/{s/([^ ]+) .*/\1/p}")"
- if [ -n "$WT" ]; then
- rm -r "$WT"
- git worktree prune
- fi
- git merge --ff-only "$1" && git push && git branch -d "$1" && git push origin :"$1"
- )
-}
-
-# Create new branch from master
-gitbnew() {
- git branch "$1" master
- local NW="$(git rev-parse --show-toplevel)-$1"
- git worktree add "$NW" $1
- cd "$NW"
- git submodule update --init --recursive
-}
-
-# Make screenshot
-xshot() {
- import -window "$(xdotool selectwindow)" ~/xshot_$(date +%F_%H%M%S_%N).png
-}
-
# Run given command every second
dorepeat() {
while true; do