Skip to content

Commit

Permalink
Show project size and corrected long project name
Browse files Browse the repository at this point in the history
New option in config.json : (showSize: true)
Style correction of long project name
Windows minimized in the dock included
  • Loading branch information
atika committed Nov 21, 2014
1 parent 1b27b76 commit 72f285d
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 12 deletions.
Binary file modified GitFinder.command/FinderFolders.scpt
Binary file not shown.
5 changes: 3 additions & 2 deletions GitFinder.command/GitFinder.coffee
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/local/bin/node

#!/usr/local/bin/node
# GitFinder Widget
# Scan Finder window looking for Git projects and display statistics
# Dominique Da Silva (Nov 2014)
Expand Down Expand Up @@ -50,7 +50,7 @@ exec '/usr/bin/osascript '+__dirname+'/FinderFolders.scpt', (error, stdout, stde
if paths.length > 0
paths.forEach (p,i) ->
thepath = p.trim()
exec 'git status >/dev/null 2>&1 && echo "$(git status -b --porcelain --ignored)" && echo "BRANCHES:$(git branch -v | wc -l | sed \'s/ //g\')" && echo "STASH:$(git stash list | wc -l | sed \'s/ //g\')" && echo "NAME:$(basename \"$(git rev-parse --show-toplevel)\")" || exit 1;', {cwd:thepath}, (error, stdout, stderr) ->
exec 'git status >/dev/null 2>&1 && echo "$(git status -b --porcelain --ignored)" && echo "BRANCHES:$(git branch -v | wc -l | sed \'s/ //g\')" && echo "STASH:$(git stash list | wc -l | sed \'s/ //g\')" && echo "SIZE:$(du -h -d0 |awk \'{print $1}\')" && echo "NAME:$(basename \"$(git rev-parse --show-toplevel)\")" || exit 1;', {cwd:thepath}, (error, stdout, stderr) ->
GitStatus = stdout.trim()
if error is null

Expand All @@ -66,6 +66,7 @@ exec '/usr/bin/osascript '+__dirname+'/FinderFolders.scpt', (error, stdout, stde
behind: GitStatusInfo.extract 'behind (\\d+)', 1
branches: GitStatus.extract 'BRANCHES:(\\d)', 1
stash: GitStatus.extract 'STASH:(\\d)', 1
size: GitStatus.extract 'SIZE:(.*)', 1
stats:
added: GitStatus.count '^[AM]'
modified: GitStatus.count '^ M'
Expand Down
3 changes: 2 additions & 1 deletion GitFinder.command/GitFinder.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions GitFinder.command/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
},
"applyBackStyle": false,
"showMark": true,
"showSize": true,
"position": "TL|20|20",
"statsAfter": false,
"statsBigger": false,
Expand Down
24 changes: 16 additions & 8 deletions GitFinder.widget/index.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
# Scan Finder window looking for Git projects and display statistics
# Dominique Da Silva (Nov 2014)
# https://github.com/atika/Ubersicht-GitFinder
# Version v0.2

command: "/usr/local/bin/node /path/to/Ubersicht/Commands/GitFinder.command/GitFinder.js"
command: "/usr/local/bin/node /Users/path/to/Commands/GitFinder.command/GitFinder.js"

refreshFrequency: 10000

Expand All @@ -16,7 +17,7 @@ render: -> """
"""

style: """
width: 270px
width: 280px
color: #FFF
font: 13px 'Helvetica'
-webkit-user-select: none
Expand All @@ -35,17 +36,17 @@ user-select: none
.head
font-size: 14px
width:100%
height:16px
float:left
padding-bottom:4px
margin-bottom: 7px
position: relative
border-bottom: solid 1px rgba(255,255,255,0.2)
.title
width: 170px
width: 55%
padding: 2px
position:absolute
overflow: hidden
float:left
a
text-decoration: none
color:inherit
Expand Down Expand Up @@ -76,11 +77,10 @@ user-select: none
border-radius: 3px
padding: 3px
.current, .sep, .remote
.current, .sep, .remote, .size
border-radius: 4px
padding:1px 5px
float: left
.sep
background-color: rgba(#17959c, 0.6)
margin: 0 2px
Expand All @@ -90,6 +90,10 @@ user-select: none
padding:0 3px 2px 4px
.remote
color: #1fc1cb
.size
opacity:0.4
padding:3px 2px 0 0
font-size: 11px
.stats
display:inline-block
Expand Down Expand Up @@ -287,8 +291,11 @@ update: (output, domEl) ->
</div>
<div class="branch">
<div class="current"></div>
<div class="sep" style="display:none">&gt;</div><div class="remote" style="display:none"></div>
<div class="size" style="display:none"></div>
<div class="sep" style="display:none">&gt;</div>
<div class="remote" style="display:none"></div>
</div>
<div class="stash" style="display:none"></div>
</div>
'
Expand Down Expand Up @@ -327,6 +334,7 @@ update: (output, domEl) ->

$(".head .title a",repoEl).html(repo.name).attr 'href','finder://'+repo.path
$(".branch .current",repoEl).html(repo.branch)
$(".branch .size",repoEl).html(repo.size).show() if prefs.showSize

remoteEl = $(".branch .remote", repoEl)
sepEl = $(".branch .sep", repoEl)
Expand Down
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
&nbsp;&nbsp;&nbsp;:pushpin: [Übersicht Widgets](http://tracesof.net/uebersicht-widgets/)
&nbsp;&nbsp;&nbsp;:page_facing_up: [Widgets GitHub Repo](https://github.com/felixhageloh/uebersicht-widgets)

Display your Git projects on your Mac OS X desktop with [Übersicht](http://tracesof.net/uebersicht/). GitFinder scan visible Finder windows and look at Git projects for display statistics.
Display your Git projects on your Mac OS X desktop with Übersicht. GitFinder scans Finder visibles windows and displays statistics for your Git projects.

It looks for current branch, remote branch, total branches, files added, modified, untracked and ignored, and project ahead, behind state.

The program also check if project has been modified to apply modification and add the new git project to the list with a nice animation.

<!-- Additionaly, you can stop the refresh process and hide the widget (press the refresh button). But this will work only with future release of Ubersicht and it still buggy. -->
Expand All @@ -32,6 +34,9 @@ Change the __absolute path of the command__ in the widget script.
command: "/usr/local/bin/node /full/path/to/the/Command/GitFinder.command/GitFinder.js"
```

## Download Latest
[GitHub > Ubersicht-GitFinder > Latest Release](https://github.com/atika/Ubersicht-GitFinder/releases/latest)

## config.json
Edit the __config.json__ located in the command folder to personalise the widget.

Expand All @@ -46,6 +51,7 @@ Edit the __config.json__ located in the command folder to personalise the widget
},
"applyBackStyle": false,
"showMark": true,
"showSize": true,
"position": "TL|20|20",
"statsAfter": false,
"statsBigger": false,
Expand All @@ -60,6 +66,7 @@ Edit the __config.json__ located in the command folder to personalise the widget
* __backStyle:__ Change the background appearence
* __applyBackStyle:__ Apply the custom style
* __showMark:__ Show the name at bottom left
* __showSize:__ Show the project folder size
* __position__:
- Top Left: ```TL|left_margin|top_margin```
- Top Right: ```TR|right_margin|top_margin```
Expand All @@ -72,4 +79,10 @@ Edit the __config.json__ located in the command folder to personalise the widget
* __autoFade:__ Auto fade widget on inactivity
* __autoFadeTimeout:__ Auto fade timeout

## Versions
* __v0.2__
- Display Project Size (config: `` showSize: true ``)
- Large projects name are displayed correctly
- Minimized windows in the dock are also displayed


Binary file modified gitfinder.widget.zip
Binary file not shown.

0 comments on commit 72f285d

Please sign in to comment.