Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #@gmic list_gimp
- #@gmic : List all G'MIC filters of the GIMP plug-in.
- list_gimp :
- # Load G'MIC filters files, including external sources.
- -v - -rm
- -m "gmic_raw : raw:$HOME/.$""1,uchar"
- -gmic_raw garagecoder.gmic
- -gmic_raw gentlemanbeggar_gmic.gmic
- -gmic_raw iain_fergusson.gmic
- -gmic_raw karos.gmic
- -gmic_raw naggobot.gmic
- -gmic_raw photocomix.gmic
- -gmic_raw ronounours.gmic
- -gmic_raw samj.gmic
- -gmic_raw tomkeil.gmic
- -gmic_raw zonderr.gmic
- -gmic_raw gmic_def.@.
- -if {@#>1} -i[1--2] ({"'\n#@gimp ________________\n'"}) -endif -y y -a y -m @{-1,t} -s -,10 -rv
- # Parse filters.
- folder=""
- -repeat @# -l[$<] -if {h>7" && "{@{-1,0-6}'=='{'"#@gimp "'}}} # Process only lines starting with '#@gimp '
- -rows 7,100% -autocrop 13 -autocrop {'" "'} # Discard '#@gimp'.
- -if {i!={':'}} # Process only non-parameters description lines.
- -s -,{':'}
- -if {@#>1} ({'$folder@{0,t}'}) -k[-1] # If line describes a regular filter
- -else # Subsection or level up.
- --autocrop {'_'} to_up={@{0,h}-h} -rm[0] # Count numbers of level ups.
- -if {$to_up>0" && "narg($folder)>=1} -l[]
- ({'$folder'}) -s +,{'@'}
- -rm[-{min(2*$to_up,@#)}--1] -a y
- -if @# folder=@{0,t} -else folder="" -endif
- -rm -endl -endif
- -if {h} folder=$folder@{0,t}@ -endif
- -rm
- -endif
- -else -rm
- -endif
- -else -rm
- -endif -endl -done
- -rv
- # Replace special codes in text strings.
- -replace_seq @{-quote\ {'<b>'}},255
- -replace_seq @{-quote\ {'</b>'}},255
- -replace_seq @{-quote\ {'<i>'}},255
- -replace_seq @{-quote\ {'</i>'}},255
- -discard 255
- -replace_seq @{-quote\ {'&'}},{'&'}
- -sort_str
- # Output list, sorted by path.
- -v + -e[] "* List of filters sorted by path:\n" -v -
- -repeat @#
- --replace_seq[$>] {'@'},@{-quote\ {'" / "'}}
- -v + -e[] @{-1,t} -v -
- -rm[-1]
- -done
- # Output list, sorted alphabetically.
- -v + -e[] "\n* List of filters, sorted alphabetically:\n" -v -
- -repeat @# -l[$>] -s +,{'@'} -autocrop 0 -mv[-1] 0 -i[1] ({'" (in \'"'}) ({'\').'}) -y y -a y -endl -done
- -sort_str
- -repeat @#
- --replace[$>] {'@'},{'/'}
- -v + -e[] @{-1,t} -v -
- -rm[-1]
- -done
- -v + -quit
Advertisement
Add Comment
Please, Sign In to add comment