summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xautogen.sh21
-rw-r--r--data/config/appearance/default/borders/borderless/selected-0.sticky-0.shaded-0.bits.db (renamed from data/config/appearance/default/borders/borderless.bits.db)bin12288 -> 12288 bytes
-rw-r--r--data/config/appearance/default/borders/default/selected-0.sticky-0.shaded-0.bits.db (renamed from data/config/appearance/default/borders/border2.bits.db)bin315392 -> 315392 bytes
-rw-r--r--data/config/appearance/default/borders/default/selected-1.sticky-0.shaded-0.bits.db (renamed from data/config/appearance/default/borders/border.bits.db)bin425984 -> 425984 bytes
-rw-r--r--src/actions.c3
-rw-r--r--src/border.c23
-rw-r--r--src/config.c25
-rw-r--r--src/e.h5
-rw-r--r--src/util.c2
9 files changed, 71 insertions, 8 deletions
diff --git a/autogen.sh b/autogen.sh
index 293b7972e..844e878ab 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -146,3 +146,24 @@ if test x$NOCONFIGURE = x; then
146else 146else
147 echo Skipping configure process. 147 echo Skipping configure process.
148fi 148fi
149
150
151cd data/config/appearance/default/borders/
152cd borderless
153ln -sf selected-0.sticky-0.shaded-0.bits.db selected-1.sticky-0.shaded-0.bits.db
154ln -sf selected-0.sticky-0.shaded-0.bits.db selected-0.sticky-1.shaded-0.bits.db
155ln -sf selected-0.sticky-0.shaded-0.bits.db selected-0.sticky-0.shaded-1.bits.db
156ln -sf selected-0.sticky-0.shaded-0.bits.db selected-1.sticky-1.shaded-0.bits.db
157ln -sf selected-0.sticky-0.shaded-0.bits.db selected-1.sticky-0.shaded-1.bits.db
158ln -sf selected-0.sticky-0.shaded-0.bits.db selected-1.sticky-1.shaded-1.bits.db
159ln -sf selected-0.sticky-0.shaded-0.bits.db selected-0.sticky-1.shaded-1.bits.db
160cd ..
161cd default
162#ln -sf selected-0.sticky-0.shaded-0.bits.db selected-1.sticky-0.shaded-0.bits.db
163ln -sf selected-0.sticky-0.shaded-0.bits.db selected-0.sticky-1.shaded-0.bits.db
164ln -sf selected-0.sticky-0.shaded-0.bits.db selected-0.sticky-0.shaded-1.bits.db
165ln -sf selected-0.sticky-0.shaded-0.bits.db selected-1.sticky-1.shaded-0.bits.db
166ln -sf selected-0.sticky-0.shaded-0.bits.db selected-1.sticky-0.shaded-1.bits.db
167ln -sf selected-0.sticky-0.shaded-0.bits.db selected-1.sticky-1.shaded-1.bits.db
168ln -sf selected-0.sticky-0.shaded-0.bits.db selected-0.sticky-1.shaded-1.bits.db
169cd ..
diff --git a/data/config/appearance/default/borders/borderless.bits.db b/data/config/appearance/default/borders/borderless/selected-0.sticky-0.shaded-0.bits.db
index 610fd9a17..610fd9a17 100644
--- a/data/config/appearance/default/borders/borderless.bits.db
+++ b/data/config/appearance/default/borders/borderless/selected-0.sticky-0.shaded-0.bits.db
Binary files differ
diff --git a/data/config/appearance/default/borders/border2.bits.db b/data/config/appearance/default/borders/default/selected-0.sticky-0.shaded-0.bits.db
index 7c9d03ffc..7c9d03ffc 100644
--- a/data/config/appearance/default/borders/border2.bits.db
+++ b/data/config/appearance/default/borders/default/selected-0.sticky-0.shaded-0.bits.db
Binary files differ
diff --git a/data/config/appearance/default/borders/border.bits.db b/data/config/appearance/default/borders/default/selected-1.sticky-0.shaded-0.bits.db
index 159753eee..159753eee 100644
--- a/data/config/appearance/default/borders/border.bits.db
+++ b/data/config/appearance/default/borders/default/selected-1.sticky-0.shaded-0.bits.db
Binary files differ
diff --git a/src/actions.c b/src/actions.c
index 29a435ca8..c62d7d072 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -747,6 +747,7 @@ e_act_cb_shade(int val, void *data)
747 e_border_adjust_limits(b); 747 e_border_adjust_limits(b);
748 if (si < b->client.h) 748 if (si < b->client.h)
749 e_add_event_timer("shader", 0.01, e_act_cb_shade, 1, data); 749 e_add_event_timer("shader", 0.01, e_act_cb_shade, 1, data);
750 e_border_apply_border(b);
750} 751}
751 752
752static void e_act_cb_unshade(int val, void *data); 753static void e_act_cb_unshade(int val, void *data);
@@ -766,11 +767,13 @@ e_act_cb_unshade(int val, void *data)
766 767
767 si = b->client.h - (int)(dif * (double)pix_per_sec); 768 si = b->client.h - (int)(dif * (double)pix_per_sec);
768 if (si < 0) si = 0; 769 if (si < 0) si = 0;
770
769 b->current.shaded = si; 771 b->current.shaded = si;
770 b->changed = 1; 772 b->changed = 1;
771 e_border_adjust_limits(b); 773 e_border_adjust_limits(b);
772 if (si > 0) 774 if (si > 0)
773 e_add_event_timer("shader", 0.01, e_act_cb_unshade, 1, data); 775 e_add_event_timer("shader", 0.01, e_act_cb_unshade, 1, data);
776 e_border_apply_border(b);
774} 777}
775 778
776static void 779static void
diff --git a/src/border.c b/src/border.c
index 263913099..90b11a594 100644
--- a/src/border.c
+++ b/src/border.c
@@ -987,15 +987,26 @@ void
987e_border_apply_border(E_Border *b) 987e_border_apply_border(E_Border *b)
988{ 988{
989 int pl, pr, pt, pb; 989 int pl, pr, pt, pb;
990 char *borders, buf[4096], *border; 990 char *borders, buf[4096], border[4096], *style = NULL;
991 int prop_selected = 0, prop_sticky = 0, prop_shaded = 0;
991 992
992 if ((!b->client.titlebar) && 993 style = "default";
993 (!b->client.border)) border = "borderless.bits.db"; 994 if ((!b->client.titlebar) && (!b->client.border)) style = "borderless";
994 else if (b->current.selected) border = "border.bits.db"; 995
995 else border = "border2.bits.db"; 996 if (b->current.selected) prop_selected = 1;
997 if (b->current.shaded == b->client.h) prop_shaded = 1;
998 if (b->client.sticky) prop_sticky = 1;
999
1000 sprintf(border, "selected-%i.sticky-%i.shaded-%i.bits.db",
1001 prop_selected, prop_sticky, prop_shaded);
996 1002
997 borders = e_config_get("borders"); 1003 borders = e_config_get("borders");
998 sprintf(buf, "%s%s", borders, border); 1004 sprintf(buf, "%s%s/%s", borders, style, border);
1005 /* if it's not changed - abort and dont do anything */
1006 if ((b->border_file) && (!strcmp(buf, b->border_file))) return;
1007 IF_FREE(b->border_file);
1008 b->border_file = strdup(buf);
1009
999 e_border_set_bits(b, buf); 1010 e_border_set_bits(b, buf);
1000 1011
1001 pl = pr = pt = pb = 0; 1012 pl = pr = pt = pb = 0;
diff --git a/src/config.c b/src/config.c
index ce91bafd6..6c3bc1d0e 100644
--- a/src/config.c
+++ b/src/config.c
@@ -1,5 +1,7 @@
1#include "e.h" 1#include "e.h"
2 2
3static char cfg_root[] = "";
4
3#define E_CONF(_key, _var, _args...) \ 5#define E_CONF(_key, _var, _args...) \
4{ \ 6{ \
5 if (!strcmp(type, _key)) \ 7 if (!strcmp(type, _key)) \
@@ -30,6 +32,12 @@ e_config_get(char *type)
30 /* as well as all data - so the only place to look is there. If you */ 32 /* as well as all data - so the only place to look is there. If you */
31 /* have no data it is all copied over for you the first time E is */ 33 /* have no data it is all copied over for you the first time E is */
32 /* run. It's a design decision. */ 34 /* run. It's a design decision. */
35 /* Later when things are a bit mroe stabilised these will look */
36 /* something like: */
37 /* E_CONF("grabs", cfg_grabs_db, */
38 /* "%sbehavior/default/grabs.db", e_config_user_dir()); */
39 /* notice it would use the user config location instead */
40 /* but for now i'm keeping it as is for development "ease" */
33 E_CONF("grabs", cfg_grabs_db, 41 E_CONF("grabs", cfg_grabs_db,
34 PACKAGE_DATA_DIR"/data/config/behavior/default/grabs.db"); 42 PACKAGE_DATA_DIR"/data/config/behavior/default/grabs.db");
35 E_CONF("settings", cfg_settings_db, 43 E_CONF("settings", cfg_settings_db,
@@ -76,10 +84,27 @@ e_config_init(void)
76 } 84 }
77} 85}
78 86
87void
88e_config_set_user_dir(char *dir)
89{
90 strcpy(cfg_root, dir);
91 /* reset the cached dir paths */
92 cfg_grabs_db[0] = 0;
93 cfg_settings_db[0] = 0;
94 cfg_actions_db[0] = 0;
95 cfg_borders_db[0] = 0;
96 cfg_user_dir[0] = 0;
97 cfg_images_dir[0] = 0;
98 cfg_fonts_dir[0] = 0;
99 /* init again - if the user hasnt got all the data */
100 e_config_init();
101}
102
79char * 103char *
80e_config_user_dir(void) 104e_config_user_dir(void)
81{ 105{
82 if (cfg_user_dir[0]) return cfg_user_dir; 106 if (cfg_user_dir[0]) return cfg_user_dir;
107 if (cfg_root[0]) return cfg_root;
83 sprintf(cfg_user_dir, "%s/.e/", e_file_home()); 108 sprintf(cfg_user_dir, "%s/.e/", e_file_home());
84 return cfg_user_dir; 109 return cfg_user_dir;
85} 110}
diff --git a/src/e.h b/src/e.h
index b318a8398..efbb10eb9 100644
--- a/src/e.h
+++ b/src/e.h
@@ -208,6 +208,8 @@ struct _E_Border
208 Evas_List grabs; 208 Evas_List grabs;
209 E_Desktop *desk; 209 E_Desktop *desk;
210 210
211 char *border_file;
212
211 int changed; 213 int changed;
212}; 214};
213 215
@@ -360,6 +362,7 @@ pid_t e_exec_run(char *exe);
360pid_t e_exec_run_in_dir(char *exe, char *dir); 362pid_t e_exec_run_in_dir(char *exe, char *dir);
361pid_t e_run_in_dir_with_env(char *exe, char *dir, int *launch_id_ret, char **env, char *launch_path); 363pid_t e_run_in_dir_with_env(char *exe, char *dir, int *launch_id_ret, char **env, char *launch_path);
362 364
365char *e_config_get(char *type);
363void e_config_init(void); 366void e_config_init(void);
367void e_config_set_user_dir(char *dir);
364char *e_config_user_dir(void); 368char *e_config_user_dir(void);
365char *e_config_get(char *type);
diff --git a/src/util.c b/src/util.c
index 744962afe..20c2596b5 100644
--- a/src/util.c
+++ b/src/util.c
@@ -70,7 +70,7 @@ e_file_cp(char *src, char *dst)
70 f2 = fopen(dst, "wb"); 70 f2 = fopen(dst, "wb");
71 if (!f2) 71 if (!f2)
72 { 72 {
73 fclose(f2); 73 fclose(f1);
74 return 0; 74 return 0;
75 } 75 }
76 while ((num = fread(buf, 1, 4096, f1)) > 0) fwrite(buf, 1, num, f2); 76 while ((num = fread(buf, 1, 4096, f1)) > 0) fwrite(buf, 1, num, f2);