summaryrefslogtreecommitdiffstatshomepage
path: root/filters/syntax-highlighting.sh
blob: 999ad0ce3d07f00a6e6d0cc8999502dd9a5e96c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh
# This script can be used to implement syntax highlighting in the cgit
# tree-view by refering to this file with the source-filter or repo.source-
# filter options in cgitrc.
#
# Note: the highlight command (http://www.andre-simon.de/) uses css for syntax
# highlighting, so you'll probably want something like the following included
# in your css file (generated by highlight 2.4.8 and adapted for cgit):
#
# table.blob .num  { color:#2928ff; }
# table.blob .esc  { color:#ff00ff; }
# table.blob .str  { color:#ff0000; }
# table.blob .dstr { color:#818100; }
# table.blob .slc  { color:#838183; font-style:italic; }
# table.blob .com  { color:#838183; font-style:italic; }
# table.blob .dir  { color:#008200; }
# table.blob .sym  { color:#000000; }
# table.blob .kwa  { color:#000000; font-weight:bold; }
# table.blob .kwb  { color:#830000; }
# table.blob .kwc  { color:#000000; font-weight:bold; }
# table.blob .kwd  { color:#010181; }

case "$1" in
	*.c)
		highlight -f -I -X -S c
		;;
	*.h)
		highlight -f -I -X -S c
		;;
	*.sh)
		highlight -f -I -X -S sh
		;;
	*.css)
		highlight -f -I -X -S css
		;;
	*)
		highlight -f -I -X -S txt
		;;
esac
an class="o">&& time_since_last_press > g_user.sleep_delay) { g_s.is_sleeping = true; app_api.performance_set(Api::perf_modes::ENTER_SHALLOW_SLEEP); app_api.display_power(false); } else if (g_s.is_sleeping && time_since_last_press < g_user.sleep_delay) { g_s.is_sleeping = false; app_api.performance_set(Api::perf_modes::EXIT_SHALLOW_SLEEP); app_api.display_power(true); } // should it be done when sleeping? app_mgr::app_all_bgrefresh(); return true; } int main() { init_all(); printf("~~~==~~~"); init_buttons(); app_api.init(); struct repeating_timer timer; add_repeating_timer_ms(250, repeating_callback, NULL, &timer); // TODO: Execute on core1 g_s.foreground_app = app_mgr::app_init(0); while (1) { if (g_s.app_switch_requested) { app_mgr::app_switch(g_s.foreground_app, g_s.app_switch_to_app); g_s.app_switch_requested = false; } if (g_s.app_ready && !g_s.is_sleeping) { app_mgr::app_render(g_s.foreground_app); app_api.display_write_backbuffer(); } if (g_s.is_sleeping) __wfi(); else sleep_ms(app_api.performance_render_interval_get()); } return 0; }