فهرست منبع

Merge b275eb83f90cfcd07fb3a9bb1bb10759674fd5cc into 895698fe401ec0df94de7d22cd0a94bfd6c82a44

_tokamach 9 سال پیش
والد
کامیت
7ffa6b7b3d
1فایلهای تغییر یافته به همراه15 افزوده شده و 0 حذف شده
  1. 15 0
      fetch

+ 15 - 0
fetch

@@ -19,6 +19,15 @@ export LC_ALL=C
 export LANG=C
 export LANG=C
 export LANGUAGE=C
 export LANGUAGE=C
 
 
+# osascript source for wallpaper detection on OSX
+wallsource="
+on run
+    tell application \"Finder\"
+        select window of desktop
+        return (get desktop picture as text)
+    end tell
+end run"
+
 
 
 # Config Options {{{
 # Config Options {{{
 
 
@@ -738,6 +747,12 @@ getwallpaper () {
             img="$(awk -F\' '/feh/ {printf $2}' $HOME/.fehbg)"
             img="$(awk -F\' '/feh/ {printf $2}' $HOME/.fehbg)"
         ;;
         ;;
 
 
+        "Mac OS X")
+            img="$(osascript -e "$wallsource" |
+                   sed 's/:/\//g' |
+                   sed 's/.*Users/\/Users/g')"
+        ;;
+
         "Windows")
         "Windows")
             case "$distro" in
             case "$distro" in
                 "Windows XP")
                 "Windows XP")