Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
O
oh-my-fish
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
oh-my-fish
Commits
39f54c28
Commit
39f54c28
authored
Jan 19, 2015
by
Felix Sonntag
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
osx plugin: Updated description implementation, improved argument checking
parent
d4acc814
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
26 additions
and
79 deletions
+26
-79
plugins/osx/README.markdown
plugins/osx/README.markdown
+0
-0
plugins/osx/cdf.fish
plugins/osx/cdf.fish
+1
-8
plugins/osx/itunes.fish
plugins/osx/itunes.fish
+2
-5
plugins/osx/manp.fish
plugins/osx/manp.fish
+1
-8
plugins/osx/pfd.fish
plugins/osx/pfd.fish
+1
-8
plugins/osx/pfs.fish
plugins/osx/pfs.fish
+1
-8
plugins/osx/pushdf.fish
plugins/osx/pushdf.fish
+1
-8
plugins/osx/ql.fish
plugins/osx/ql.fish
+4
-9
plugins/osx/tab.fish
plugins/osx/tab.fish
+1
-8
plugins/osx/trash.fish
plugins/osx/trash.fish
+14
-17
No files found.
plugins/osx/
OSX-
README.markdown
→
plugins/osx/README.markdown
View file @
39f54c28
File moved
plugins/osx/cdf.fish
View file @
39f54c28
# cd to the current Finder directory
function cdf
if count $argv >/dev/null
switch $argv[1]
case -d --description
echo "cd to the current Finder directory"
return 0
end
end
function cdf -d "cd to the current Finder directory"
cd (pfd)
end
\ No newline at end of file
plugins/osx/itunes.fish
View file @
39f54c28
# Play, pause etc. iTunes
function itunes
if
count $argv >/dev/null
function itunes
-d "Play, pause etc. iTunes. Use -h or --help for a more detailed description."
if
[ (count $argv) -gt 0 ]
set -l opt $argv[1]
switch $opt
case -d --description
echo "Play, pause etc. iTunes. Use -h or --help for a more detailed description."
return 0
case launch play pause stop rewind resume quit
case mute
set opt "set mute to true"
...
...
plugins/osx/manp.fish
View file @
39f54c28
# Open a specified man page in Preview
function manp
if count $argv >/dev/null
switch $argv[1]
case -d --description
echo "Open a specified man page in Preview"
return 0
end
end
function manp -d "Open a specified man page in Preview"
man -t $argv | open -f -a Preview
end
\ No newline at end of file
plugins/osx/pfd.fish
View file @
39f54c28
# Return the path of the frontmost Finder window
function pfd
if count $argv >/dev/null
switch $argv[1]
case -d --description
echo "Return the path of the frontmost Finder window"
return 0
end
end
function pfd -d "Return the path of the frontmost Finder window"
osascript 2>/dev/null -e '
tell application "Finder"
return POSIX path of (target of window 1 as alias)
...
...
plugins/osx/pfs.fish
View file @
39f54c28
# Return the path of the frontmost Finder window
function pfs
if count $argv >/dev/null
switch $argv[1]
case -d --description
echo "Return the path of the frontmost Finder window"
return 0
end
end
function pfs -d "Return the path of the frontmost Finder window"
osascript 2>/dev/null -e '
set output to ""
tell application "Finder" to set the_selection to selection
...
...
plugins/osx/pushdf.fish
View file @
39f54c28
# pushd to the current Finder directory
function pushdf
if count $argv >/dev/null
switch $argv[1]
case -d --description
echo "pushd to the current Finder directory"
return 0
end
end
function pushdf -d "pushd to the current Finder directory"
pushd (pfd)
end
\ No newline at end of file
plugins/osx/ql.fish
View file @
39f54c28
# Quick Look a specified file
function ql
if count $argv >/dev/null
switch $argv[1]
case -d --description
echo "Quick Look a specified file"
return 0
end
end
if count $argv > 0
function ql -d "Quick Look a specified file"
if [ (count $argv) -gt 0 ]
qlmanage >/dev/null ^/dev/null -p Applications/ &
else
echo "No file or folder as argument given"
end
end
\ No newline at end of file
plugins/osx/tab.fish
View file @
39f54c28
# Open the current directory in a new tab
function tab
if count $argv >/dev/null
switch $argv[1]
case -d --description
echo "Open the current directory in a new tab"
return 0
end
end
function tab -d "Open the current directory in a new tab"
osascript 2>/dev/null -e '
tell application "System Events"
tell process "Terminal" to keystroke "t" using command down
...
...
plugins/osx/trash.fish
View file @
39f54c28
# Move a specified file to the Trash
function trash
if count $argv >/dev/null
switch $argv[1]
case -d --description
echo "Move a specified file to the Trash"
return 0
end
end
set -l trash_dir "$HOME/.Trash"
for item in $argv
if test -e $item
set -l item_name (basename $item)
if test -e "$trash_dir/$item_name"
set -l current_time (date "+%H.%M.%S")
mv -f "$item" "$trash_dir/$item_name $current_time"
else
mv -f "$item" "$trash_dir/"
function trash -d "Move a specified file to the Trash"
if [ (count $argv) -gt 0 ]
set -l trash_dir "$HOME/.Trash"
for item in $argv
if test -e $item
set -l item_name (basename $item)
if test -e "$trash_dir/$item_name"
set -l current_time (date "+%H.%M.%S")
mv -f "$item" "$trash_dir/$item_name $current_time"
else
mv -f "$item" "$trash_dir/"
end
end
end
else
echo "No file(s) given to delete"
end
end
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment