Guest User

Untitled

a guest
Dec 12th, 2012
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.24 KB | None | 0 0
  1. #@gmic list_gimp
  2. #@gmic : List all G'MIC filters of the GIMP plug-in.
  3. list_gimp :
  4.  
  5.   # Load G'MIC filters files, including external sources.
  6.   -v - -rm
  7.   -m "gmic_raw : raw:$HOME/.$""1,uchar"
  8.   -gmic_raw garagecoder.gmic
  9.   -gmic_raw gentlemanbeggar_gmic.gmic
  10.   -gmic_raw iain_fergusson.gmic
  11.   -gmic_raw karos.gmic
  12.   -gmic_raw naggobot.gmic
  13.   -gmic_raw photocomix.gmic
  14.   -gmic_raw ronounours.gmic
  15.   -gmic_raw samj.gmic
  16.   -gmic_raw tomkeil.gmic
  17.   -gmic_raw zonderr.gmic
  18.   -gmic_raw gmic_def.@.
  19.   -if {@#>1} -i[1--2] ({"'\n#@gimp ________________\n'"}) -endif -y y -a y -m @{-1,t} -s -,10 -rv
  20.  
  21.   # Parse filters.
  22.   folder=""
  23.   -repeat @# -l[$<] -if {h>7" && "{@{-1,0-6}'=='{'"#@gimp "'}}}  # Process only lines starting with '#@gimp '
  24.     -rows 7,100% -autocrop 13 -autocrop {'" "'} # Discard '#@gimp'.
  25.     -if {i!={':'}} # Process only non-parameters description lines.
  26.       -s -,{':'}
  27.       -if {@#>1} ({'$folder@{0,t}'}) -k[-1] # If line describes a regular filter
  28.       -else # Subsection or level up.
  29.         --autocrop {'_'} to_up={@{0,h}-h} -rm[0]  # Count numbers of level ups.
  30.         -if {$to_up>0" && "narg($folder)>=1} -l[]
  31.           ({'$folder'}) -s +,{'@'}
  32.           -rm[-{min(2*$to_up,@#)}--1] -a y
  33.           -if @# folder=@{0,t} -else folder="" -endif
  34.         -rm -endl -endif
  35.         -if {h} folder=$folder@{0,t}@ -endif
  36.         -rm
  37.       -endif
  38.     -else -rm
  39.     -endif
  40.   -else -rm
  41.   -endif -endl -done
  42.   -rv
  43.  
  44.   # Replace special codes in text strings.
  45.   -replace_seq @{-quote\ {'<b>'}},255
  46.   -replace_seq @{-quote\ {'</b>'}},255
  47.   -replace_seq @{-quote\ {'<i>'}},255
  48.   -replace_seq @{-quote\ {'</i>'}},255
  49.   -discard 255
  50.   -replace_seq @{-quote\ {'&amp;'}},{'&'}
  51.   -sort_str
  52.  
  53.   # Output list, sorted by path.
  54.   -v + -e[] "* List of filters sorted by path:\n" -v -
  55.   -repeat @#
  56.     --replace_seq[$>] {'@'},@{-quote\ {'" / "'}}
  57.     -v + -e[] @{-1,t} -v -
  58.     -rm[-1]
  59.   -done
  60.  
  61.   # Output list, sorted alphabetically.
  62.   -v + -e[] "\n* List of filters, sorted alphabetically:\n" -v -
  63.   -repeat @# -l[$>] -s +,{'@'} -autocrop 0 -mv[-1] 0 -i[1] ({'" (in \'"'}) ({'\').'}) -y y -a y -endl -done
  64.   -sort_str
  65.   -repeat @#
  66.     --replace[$>] {'@'},{'/'}
  67.     -v + -e[] @{-1,t} -v -
  68.     -rm[-1]
  69.   -done
  70.   -v + -quit
Advertisement
Add Comment
Please, Sign In to add comment