summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.bashrc84
1 files changed, 44 insertions, 40 deletions
diff --git a/.bashrc b/.bashrc
index bc1b2d2..34c4e38 100644
--- a/.bashrc
+++ b/.bashrc
@@ -269,18 +269,57 @@ EOF
fg() {
builtin fg >/dev/null
}
- alias fg="fg"
+
+ # Run in the background
+ bgr() {
+ nohup sh -c "$@" >~/nohup.out 2>&1 &
+ disown
+ }
+
+ # Kill process and run in the background
+ res() {
+ pkill $@
+ bgr $@
+ }
+
+ # Launch .desktop application (either full path or just name)
+ dela() {
+ name=$1
+ if [[ ${name:0:1} != "/" ]]; then
+ name="/usr/share/applications/${name}"
+ fi
+ if [[ ! $name =~ .desktop$ ]]; then
+ name+=".desktop"
+ fi
+ comm=($(awk -F= '$1=="Exec"{$1=""; print}' "$name"))
+ bgr "$comm"
+ }
# }}}
# Variables {{{
export NIX_SHELL_PRESERVE_PROMPT=1
# }}}
-bind '"\C-l":clear-screen'
+# File operations {{{
+ cp() {
+ command cp -p $@
+ }
+
+ metas() {
+ for file in *; do
+ [ "$file" != 'cover.jpeg' ] && \
+ kid3-cli -c "set title \"$(echo "$file" | sed -e "s/\.[^.]*$//")\"" \
+ -c "set artist \"$1\"" -c "set album \"$2\"" -c "set date \"$3\"" \
+ -c 'set picture:"./cover.jpeg" ""' "$file" \
+ || :
+ done
+ }
+# }}}
+
+# Bindings {{{
+ bind '"\C-l":clear-screen'
+# }}}
-cp() {
- command cp -p $@
-}
if [ -n "$ZSHRC_FUNTOO" ]
then
@@ -325,18 +364,6 @@ fi
# zle -N plumb-store-cwd
# bindkey "^[[5;7~" plumb-store-cwd
-# Run in the background
-bgr() {
- nohup sh -c "$@" >~/nohup.out 2>&1 &
- disown
-}
-
-# Kill process and run in the background
-res() {
- pkill $@
- bgr $@
-}
-
# Open vim with .vim-session file, if it exists and the vim command doesn't have any parameters
v() {
if [ -f ".vim-session" ] && [ -z "$1" ]; then
@@ -357,29 +384,6 @@ onemo() {
bgr "nemo ./"
}
-# Launch .desktop application (either full path or just name)
-dela() {
- name=$1
- if [[ ${name:0:1} != "/" ]]; then
- name="/usr/share/applications/${name}"
- fi
- if [[ ! $name =~ .desktop$ ]]; then
- name+=".desktop"
- fi
- comm=($(awk -F= '$1=="Exec"{$1=""; print}' "$name"))
- bgr "$comm"
-}
-
-metas() {
- for file in *; do
- [ "$file" != 'cover.jpeg' ] && \
- kid3-cli -c "set title \"$(echo "$file" | sed -e "s/\.[^.]*$//")\"" \
- -c "set artist \"$1\"" -c "set album \"$2\"" -c "set date \"$3\"" \
- -c 'set picture:"./cover.jpeg" ""' "$file" \
- || :
- done
-}
-
#
# Aliases
#