Advertisement
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}
- -autocrop[0] {'" "'}
- -if {narg($folder)} ({'$folder@{0,t}'}) -k[-1] -else -rm -endif # If line describes a regular filter
- -else # If line describes a new section or a upped level.
- --autocrop {'_'} to_up={@{0,h}-h} -rm[0] # Count numbers of upped levels.
- -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.
- -exec "date +%Y,%m,%d >"@{-path_tmp}/date.dlm
- @{-path_tmp}/date.dlm
- -v + -e[] "\n*** List of filters in the G'MIC plug-in for GIMP ("@#" filters, on "{i}/{i(1)}/{i(2)}") ***\n" -v -
- -rm[-1]
- -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
- strb=" (in \'" -i[1] ({'$strb'})
- stre="\')." ({'$stre'})
- -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
Advertisement