cleaned some tabs, add debug option to makefile

This commit is contained in:
fenze 2022-05-15 22:59:53 +02:00
parent 5c0533dc69
commit 76e48c89f9
5 changed files with 11 additions and 20 deletions

View File

@ -18,9 +18,9 @@
#define DARKMODE 2
#define SCROLLBARS 3
#define KEYBINDS static Key keys[] =
#define APPERANCE static int appearance[] =
#define OPTIONS static char *options[] =
#define KEYBINDS static inline Key keys[]
#define APPERANCE static inline int appearance[]
#define OPTIONS static inline char *options[]
typedef struct {
unsigned modkey;

View File

@ -25,6 +25,9 @@ rose:
$(CC) -fPIC -O3 -o rose *.c $(CFLAGS) $(LIBS) $(OPTIONS)
strip ./rose
debug:
$(CC) -fPIC -o rose *.c $(CFLAGS) $(LIBS) $(OPTIONS) -Wall -Wextra
config.h:
[ -f "$@" ] || cp config.def.h $@

1
rose.h
View File

@ -20,4 +20,3 @@ static Atom atoms[AtomLast];
static Display *dpy;
const char* getatom(int a);
void setatom(int a, const char *v);
static int spair[2];

View File

@ -131,8 +131,6 @@ static void rose_download(const char* uri)
int id = fork();
if (id == 0) {
close(spair[0]);
close(spair[1]);
setsid();
char *argv[] = { "/bin/sh", "-c", "st -e /bin/sh -c", "\"aria2c \\", cmd, "\"", NULL };
execvp("/bin/sh", argv);
@ -141,16 +139,14 @@ static void rose_download(const char* uri)
}
}
static void rose_response_reciver(WebKitDownload *download,
GParamSpec *pspec)
static void rose_response_reciver(WebKitDownload *download)
{
const char *uri = webkit_uri_response_get_uri(webkit_download_get_response(download));
rose_download(uri);
}
static void rose_download_callback(WebKitWebContext *context,
WebKitDownload *download)
static void rose_download_callback(WebKitDownload *download)
{
g_signal_connect(G_OBJECT(download), "notify::response",
G_CALLBACK(rose_response_reciver), NULL);
@ -159,7 +155,6 @@ static void rose_download_callback(WebKitWebContext *context,
GtkWidget* rose_webview_new()
{
char cookiefile[128];
WebKitWebView *webview;
WebKitCookieManager *cookiemanager;
WebKitUserContentManager *contentmanager;

View File

@ -76,8 +76,6 @@ static gboolean key_press_callback(RoseWindow *window,
if (id == 0) {
if (dpy)
close(ConnectionNumber(dpy));
close(spair[0]);
close(spair[1]);
setsid();
char* argument_list[] = { "/bin/sh", "-c", "dmenu_rose", NULL};
execvp("/bin/sh", argument_list);
@ -95,8 +93,6 @@ static gboolean key_press_callback(RoseWindow *window,
if (id == 0) {
if (dpy)
close(ConnectionNumber(dpy));
close(spair[0]);
close(spair[1]);
setsid();
char* argument_list[] = { "/bin/sh", "-c", "dmenu_rose\tfind", NULL};
execvp("/bin/sh", argument_list);
@ -166,8 +162,6 @@ static gboolean key_press_callback(RoseWindow *window,
case history: {
int id = fork();
if (id == 0) {
close(spair[0]);
close(spair[1]);
setsid();
char* argument_list[] = { "/bin/sh", "-c", "dmenu_rose\thistory", NULL};
execvp("/bin/sh", argument_list);