Skip to content

Commit

Permalink
Modified "go" alias to support multiple args/files
Browse files Browse the repository at this point in the history
  • Loading branch information
jarvisschultz committed Jan 25, 2018
1 parent 2b7b703 commit 50cf5d2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bash_aliases.bash
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ function girelease() {


alias eps2pgf='java -jar /home/jarvis/src/eps2pgf/eps2pgf.jar'
alias go='xdg-open'
alias go='my-xdg-open.sh'
alias ur='sudo service udev reload'
alias tt='nautilus . &'
alias E='$EDITOR'
Expand Down
18 changes: 18 additions & 0 deletions my_bash_scripts/my-xdg-open.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
if [ $# -eq 0 ]; then
xdg-open . &> /dev/null
else
for file in "$@"; do
xdg-open "$file" &> /dev/null
done
fi

# #!/bin/bash
# set -euo pipefail; shopt -s failglob # bash strict mode

# max=${max:-10} # Set default maximum if $max is not set
# [[ ${all:-} ]] && max=$# # Set max to all files if $all is non-null

# for file in "${@:1:$max}"; do
# xdg-open "$file"
# done &>>~/.xsession-errors

0 comments on commit 50cf5d2

Please sign in to comment.