-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
37 changed files
with
2,320 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
project('sulfer', 'c', version: '0.1.0', | ||
default_options: ['warning_level=3', 'c_std=gnu18']) | ||
|
||
cc = meson.get_compiler('c') | ||
cfg_lib_dirs = ['/usr/local/lib/', '/usr/lib', '/usr/share/lib'] | ||
cfg_dep = cc.find_library('libconfuse', dirs: cfg_lib_dirs) | ||
|
||
gtk_dep = dependency('gtk+-3.0') | ||
x11_dep = dependency('x11', method: 'pkg-config') | ||
webkit_dep = dependency('webkit2gtk-4.0', method: 'pkg-config') | ||
|
||
src = ['src/sulfer.c', 'src/cfg/cfg.c', 'src/cfg/config.c', 'src/frame/frame.c', 'src/frame/handle.c', 'src/uri/uri.c', 'src/util/util.c', 'src/util/atom.c', 'src/util/path.c'] | ||
|
||
incs = include_directories('src/') | ||
ldflags = ['-l:libconfuse.a', '-lgthread-2.0'] | ||
|
||
run_target('cp', command: ['cp', '-f', 'src/main.ui', '~/.config/sulfer/']) | ||
|
||
exec = executable('sulfer', sources: src, dependencies : [gtk_dep, x11_dep, webkit_dep, cfg_dep], include_directories: incs, install: true, build_by_default: true) | ||
|
||
custom_target('ui', depends: exec, | ||
input: exec, output: 'main.ui', | ||
command: ['src/sh/install.sh'], | ||
build_by_default: true) | ||
|
||
meson.add_install_script('src/sh/final.sh') |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[Desktop Entry] | ||
Name=Sulfer | ||
Exec=sulfer %u | ||
Icon=sulfer | ||
GenericName=Web Browser | ||
Comment=Surf the web | ||
Type=Application | ||
Terminal=false | ||
Categories=Network;WebBrowser; | ||
StartupNotify=true | ||
Keywords=Browser;Web; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
/* | ||
* cfg/cfg.c: | ||
* Intended for loading the configuration file via libconfuse | ||
* by default: ~/.config/sulfer/sulfer.conf | ||
*/ | ||
|
||
#include <confuse.h> | ||
#include <string.h> | ||
#include <stdlib.h> | ||
|
||
#include "../util/util.h" | ||
|
||
#include "cfg.h" | ||
|
||
static conf_opt *config; | ||
|
||
extern conf_opt *cfg_get(void) | ||
{ | ||
return config; | ||
} | ||
|
||
extern conf_opt *cfg_load(char *name) | ||
{ | ||
cfg_t *cfg; | ||
|
||
config = ecalloc(conf_len, sizeof(conf_opt)); | ||
|
||
cfg_opt_t opts[] = { | ||
CFG_STR("cache_prefix", "~/.cache/sulfer", CFGF_NONE), | ||
CFG_BOOL("ephemeral", cfg_false, CFGF_NONE), | ||
CFG_BOOL("java", cfg_true, CFGF_NONE), | ||
CFG_BOOL("javascript", cfg_true, CFGF_NONE), | ||
CFG_BOOL("xss_auditor", cfg_true, CFGF_NONE), | ||
CFG_BOOL("js_auto_popups", cfg_false, CFGF_NONE), | ||
CFG_STR("font_family", "sans-serif", CFGF_NONE), | ||
CFG_INT("font_size", 16, CFGF_NONE), | ||
CFG_STR("charset", "UTF_8", CFGF_NONE), | ||
CFG_BOOL("developer_extras", cfg_false, CFGF_NONE), | ||
CFG_BOOL("dns_prefetching", cfg_false, CFGF_NONE), | ||
CFG_BOOL("caret_browsing", cfg_false, CFGF_NONE), | ||
CFG_BOOL("media", cfg_true, CFGF_NONE), | ||
CFG_BOOL("webaudio", cfg_true, CFGF_NONE), | ||
CFG_BOOL("webgl", cfg_true, CFGF_NONE), | ||
CFG_BOOL("site_quirks", cfg_true, CFGF_NONE), | ||
CFG_BOOL("smooth_scrolling", cfg_true, CFGF_NONE), | ||
CFG_STR("user_agent", "", CFGF_NONE), | ||
CFG_INT("hardware_accel", 2, CFGF_NONE), | ||
CFG_INT("cookie_policy", 2, CFGF_NONE), | ||
CFG_BOOL("itp", cfg_true, CFGF_NONE), | ||
CFG_BOOL("tls_error_policy", cfg_true, CFGF_NONE), | ||
CFG_STR("search_engine", "searx", CFGF_NONE), | ||
CFG_BOOL("dark_mode", cfg_true, CFGF_NONE), | ||
CFG_BOOL("scrollbar", cfg_true, CFGF_NONE), | ||
CFG_END() | ||
}; | ||
|
||
cfg = cfg_init(opts, CFGF_NOCASE); | ||
if(cfg_parse(cfg, name) == CFG_PARSE_ERROR) | ||
die(1, "[ERROR] Unable to parse config: %s\n", name); | ||
|
||
config[conf_cache_prefix].s = strdup(cfg_getstr(cfg, "cache_prefix")); | ||
config[conf_ephemeral].i = cfg_getbool(cfg, "ephemeral"); | ||
config[conf_java].i = cfg_getbool(cfg, "java"); | ||
config[conf_javascript].i = cfg_getbool(cfg, "javascript"); | ||
config[conf_xss_auditor].i = cfg_getbool(cfg, "xss_auditor"); | ||
config[conf_js_auto_popups].i = cfg_getbool(cfg, "js_auto_popups"); | ||
config[conf_font_family].s = strdup(cfg_getstr(cfg, "font_family")); | ||
config[conf_font_size].i = cfg_getint(cfg, "font_size"); | ||
config[conf_charset].s = strdup(cfg_getstr(cfg, "charset")); | ||
config[conf_developer_extras].i = cfg_getbool(cfg, "developer_extras"); | ||
config[conf_dns_prefetching].i = cfg_getbool(cfg, "dns_prefetching"); | ||
config[conf_caret_browsing].i = cfg_getbool(cfg, "caret_browsing"); | ||
config[conf_media].i = cfg_getbool(cfg, "media"); | ||
config[conf_webaudio].i = cfg_getbool(cfg, "webaudio"); | ||
config[conf_webgl].i = cfg_getbool(cfg, "webgl"); | ||
config[conf_site_quirks].i = cfg_getbool(cfg, "site_quirks"); | ||
config[conf_smooth_scrolling].i = cfg_getbool(cfg, "smooth_scrolling"); | ||
config[conf_user_agent].s = strdup(cfg_getstr(cfg, "user_agent")); | ||
config[conf_hardware_accel].i = cfg_getint(cfg, "hardware_accel"); | ||
config[conf_cookie_policy].i = cfg_getint(cfg, "cookie_policy"); | ||
config[conf_itp].i = cfg_getbool(cfg, "itp"); | ||
config[conf_tls_error_policy].i = cfg_getbool(cfg, "tls_error_policy"); | ||
config[conf_search_engine].s = strdup(cfg_getstr(cfg, "search_engine")); | ||
config[conf_dark_mode].i = cfg_getbool(cfg, "dark_mode"); | ||
config[conf_scrollbar].i = cfg_getbool(cfg, "scrollbar"); | ||
|
||
cfg_free(cfg); | ||
|
||
return config; | ||
} | ||
|
||
extern void cfg_cleanup(void) | ||
{ | ||
free(config[conf_cache_prefix].s); | ||
free(config[conf_font_family].s); | ||
free(config[conf_charset].s); | ||
free(config[conf_user_agent].s); | ||
free(config[conf_search_engine].s); | ||
free(config); | ||
} |
Oops, something went wrong.