Advertisement
Guest User

Untitled

a guest
Dec 12th, 2012
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.57 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}
  28.         -autocrop[0] {'" "'}
  29.         -if {narg($folder)} ({'$folder@{0,t}'}) -k[-1] -else -rm -endif # If line describes a regular filter
  30.       -else # If line describes a new section or a upped level.
  31.         --autocrop {'_'} to_up={@{0,h}-h} -rm[0]  # Count numbers of upped levels.
  32.         -if {$to_up>0" && "narg($folder)>=1} -l[]
  33.           ({'$folder'}) -s +,{'@'}
  34.           -rm[-{min(2*$to_up,@#)}--1] -a y
  35.           -if @# folder=@{0,t} -else folder="" -endif
  36.         -rm -endl -endif
  37.         -if {h} folder=$folder@{0,t}@ -endif
  38.         -rm
  39.       -endif
  40.     -else -rm
  41.     -endif
  42.   -else -rm
  43.   -endif -endl -done
  44.   -rv
  45.  
  46.   # Replace special codes in text strings.
  47.   -replace_seq @{-quote\ {'<b>'}},255
  48.   -replace_seq @{-quote\ {'</b>'}},255
  49.   -replace_seq @{-quote\ {'<i>'}},255
  50.   -replace_seq @{-quote\ {'</i>'}},255
  51.   -discard 255
  52.   -replace_seq @{-quote\ {'&amp;'}},{'&'}
  53.   -sort_str
  54.  
  55.   # Output list, sorted by path.
  56.   -exec "date +%Y,%m,%d >"@{-path_tmp}/date.dlm
  57.   @{-path_tmp}/date.dlm
  58.   -v + -e[] "\n*** List of filters in the G'MIC plug-in for GIMP ("@#" filters, on "{i}/{i(1)}/{i(2)}") ***\n" -v -
  59.   -rm[-1]
  60.  
  61.   -v + -e[] "* List of filters sorted by path:\n" -v -
  62.   -repeat @#
  63.     --replace_seq[$>] {'@'},@{-quote\ {'" / "'}}
  64.     -v + -e[] @{-1,t} -v -
  65.     -rm[-1]
  66.   -done
  67.  
  68.   # Output list, sorted alphabetically.
  69.   -v + -e[] "\n* List of filters, sorted alphabetically:\n" -v -
  70.   -repeat @# -l[$>] -s +,{'@'} -autocrop 0 -mv[-1] 0
  71.   strb=" (in \'" -i[1] ({'$strb'})
  72.   stre="\')." ({'$stre'})
  73.   -y y -a y -endl -done
  74.   -sort_str
  75.   -repeat @#
  76.   --replace[$>] {'@'},{'/'}
  77.     -v + -e[] @{-1,t} -v -
  78.     -rm[-1]
  79.   -done
  80.   -v + -quit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement