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
98a82835
Commit
98a82835
authored
Jan 16, 2015
by
Felix Sonntag
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added osx plugin
parent
80ed2cf0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
122 additions
and
0 deletions
+122
-0
plugins/README.markdown
plugins/README.markdown
+1
-0
plugins/osx/OSX-README.markdown
plugins/osx/OSX-README.markdown
+17
-0
plugins/osx/osx.load
plugins/osx/osx.load
+104
-0
No files found.
plugins/README.markdown
View file @
98a82835
...
...
@@ -22,6 +22,7 @@
*
__node__ – Adds locally installed NodeJS
`npm`
binary executable modules to the path.
*
__percol__ – Browse your fish history with
[
percol
](
https://github.com/mooz/percol
)
.
*
__peco__ – Browse your fish history with
[
peco
](
https://github.com/peco/peco
)
.
*
__osx__ - Integration with Finder and iTunes.
*
__php__ – Manage phphttp server.
*
__plenv__ –
[
plenv
](
https://github.com/tokuhirom/plenv
)
Perl binary manager integration.
*
__pyenv__ –
[
Simple Python Version Management
](
https://github.com/yyuu/pyenv
)
integration.
...
...
plugins/osx/OSX-README.markdown
0 → 100644
View file @
98a82835
osx
---
**Maintainer:**
[
cykeb
](
https://github.com/CYKEB
)
Inspired by the oh-my-zsh plugin by
[
sorin-ionescu
](
https://github.com/sorin-ionescu
)
https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/osx/osx.plugin.zsh
-
`tab`
- open the current directory in a new tab
-
`pfd`
- return the path of the frontmost Finder window
-
`pfs`
- return the current Finder selection
-
`cdf`
- cd to the current Finder directory
-
`pushdf`
- pushd to the current Finder directory
-
`ql`
- Quick Look a specified file
-
`manp`
- open a specified man page in Preview
-
`trash`
- move a specified file to the Trash
-
`itunes`
- play, pause etc. iTunes
plugins/osx/osx.load
0 → 100644
View file @
98a82835
# ------------------------------------------------------------------------------
# FILE: osx.fish
# DESCRIPTION: oh-my-fish plugin file.
# AUTHOR: Felix Sonntag
# VERSION: 1.0
# COMMENT: Inspired by the oh-my-zsh plugin by Sorin Ionescu (sorin.ionescu@gmail.com)
# https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/osx/osx.plugin.zsh
# ------------------------------------------------------------------------------
function tab
osascript 2>/dev/null -e '
tell application "System Events"
tell process "Terminal" to keystroke "t" using command down
end tell'
end
function pfd
osascript 2>/dev/null -e '
tell application "Finder"
return POSIX path of (target of window 1 as alias)
end tell'
end
function cdf
cd (pfd)
end
function pushdf
pushd (pfd)
end
function ql
if count $argv > 0
qlmanage >/dev/null ^/dev/null -p Applications/ &
end
end
function manp
man -t $argv | open -f -a Preview
end
function trash
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 currentTime (date "+%H.%M.%S")
mv -f "$item" "$trash_dir/$item_name $currentTime"
else
mv -f "$item" "$trash_dir/"
end
end
end
end
function pfs
osascript 2>/dev/null -e '
set output to ""
tell application "Finder" to set the_selection to selection
set item_count to count the_selection
repeat with item_index from 1 to count the_selection
if item_index is less than item_count then set the_delimiter to "\n"
if item_index is item_count then set the_delimiter to ""
set output to output & ((item item_index of the_selection as alias)\'s POSIX path) & the_delimiter
end repeat'
end
function itunes
set -l opt $argv[1]
switch $opt
case launch play pause stop rewind resume quit
;;
case mute
set opt "set mute to true"
;;
case unmute
set opt "set mute to false"
;;
case next previous
set opt "$opt track"
;;
case vol volume
set opt "set sound volume to $argv[2]"
;;
case "" -h --help
return 0
;;
case '*'
echo "Usage: itunes <option>"
echo "option:"
echo \t"launch|play|pause|stop|rewind|resume|quit"
echo \t"mute|unmute\tcontrol volume set"
echo \t"next|previous\tplay next or previous track"
echo \t"shuf|shuffle [on|off|toggle]"\t"Set shuffled playback. Default: toggle. Note: toggle doesn't support the MiniPlayer."
echo \t"vol"\t"Set the volume, takes an argument from 0 to 100"
echo \t"help"\t"show this message and exit"
return 1
;;
end
osascript -e "tell application \"iTunes\" to $opt"
end
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