Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f628cba966 | ||
|
|
a922884485 | ||
|
|
66a6238014 | ||
|
|
5e8c65b87e | ||
|
|
7737edff47 | ||
|
|
b7e7743b21 | ||
|
|
7232feee5a | ||
|
|
6b127f9661 | ||
|
|
e2641092b8 | ||
|
|
49e7f54d2f | ||
|
|
0f00212c58 | ||
|
|
dba0e66646 | ||
|
|
2ed7ecb08d | ||
|
|
f9cb16a0f0 |
16
ChangeLog
16
ChangeLog
@@ -1,3 +1,18 @@
|
||||
2021-05-29 17.0.1
|
||||
- Fixes:
|
||||
- Crash on panel cleanup in single-monitor execp (issue #801)
|
||||
2021-04-18 17.0
|
||||
- Fixes:
|
||||
- Crash when a window icon is large (issue #786) (santouits)
|
||||
- Minute clock doesn't update (issue #786)
|
||||
- Scrollbars in tint2conf (issue #796)
|
||||
- Preserve item order when skipping executors (issue #799)
|
||||
- Image memory leak (issues #704, #721) (Adam M. Trofa)
|
||||
- Incorrect timeout microsecond computation leading to high CPU usage (issue #800)
|
||||
- Enhancements:
|
||||
- Port tint2conf to gtk3 (issue #380)
|
||||
- execp_monitor config (issue #799)
|
||||
- Improved executor examples (Nikita Zlobin)
|
||||
2019-07-14 16.7
|
||||
- Fixes:
|
||||
- Fix spacing around icons in executor without text in vertical panels (issue #716)
|
||||
@@ -1031,3 +1046,4 @@ released tint-0.2
|
||||
.
|
||||
.
|
||||
.
|
||||
.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Latest stable release: 16.7
|
||||
Changes: https://gitlab.com/o9000/tint2/blob/16.7/ChangeLog
|
||||
# Latest stable release: 17.0.1
|
||||
Changes: https://gitlab.com/o9000/tint2/blob/17.0.1/ChangeLog
|
||||
|
||||
Documentation: [doc/tint2.md](doc/tint2.md)
|
||||
|
||||
@@ -8,7 +8,7 @@ Compile it with (after you install the [dependencies](https://gitlab.com/o9000/t
|
||||
```
|
||||
git clone https://gitlab.com/o9000/tint2.git
|
||||
cd tint2
|
||||
git checkout 16.7
|
||||
git checkout 17.0.1
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
|
||||
@@ -609,6 +609,7 @@ panel_size = 94% 30
|
||||
<li><p><code>execp_background_id = integer</code> : Which background to use. <em>(since 0.12.4)</em></p></li>
|
||||
<li><p><code>execp_centered = boolean (0 or 1)</code> : Whether to center the text. <em>(since 0.12.4)</em></p></li>
|
||||
<li><p><code>execp_padding = horizontal_padding vertical_padding spacing_between_icon_and_text</code> <em>(since 0.12.4)</em></p></li>
|
||||
<li><p><code>execp_monitor = integer (1, 2, ...), primary or all</code> : On which monitor to draw the executor. The first monitor is <code>1</code>. <em>(since 17.0)</em></p></li>
|
||||
<li><p><code>execp_lclick_command = text</code> : Command to execute on left click. If not defined, <code>execp_command</code> is executed immediately, unless it is currently running. <em>(since 0.12.4)</em></p></li>
|
||||
<li><p><code>execp_mclick_command = text</code> : Command to execute on right click. If not defined, <code>execp_command</code> is executed immediately, unless it is currently running. <em>(since 0.12.4)</em></p></li>
|
||||
<li><p><code>execp_rclick_command = text</code> : Command to execute on middle click. If not defined, <code>execp_command</code> is executed immediately, unless it is currently running. <em>(since 0.12.4)</em></p></li>
|
||||
@@ -647,13 +648,13 @@ execp_command = ping -i 1 -c 1 -W 1 -O -D -n $(ip route | grep default | grep vi
|
||||
execp_continuous = 0
|
||||
execp_interval = 1
|
||||
execp_markup = 1
|
||||
</code></pre></div><h5 id="memory-usage">Memory usage<a name="memory-usage" href="#memory-usage" class="md2man-permalink" title="permalink"></a></h5><div class="highlight"><pre class="highlight plaintext"><code>execp = new
|
||||
execp_command = free | awk '/^-/ { printf "Mem: '$(free -h | awk '/^Mem:/ { print $2 }')' %.0f%%\n", 100*$3/($3+$4); fflush(stdout) }'
|
||||
execp_interval = 5
|
||||
execp_continuous = 0
|
||||
</code></pre></div><h5 id="network-load">Network load<a name="network-load" href="#network-load" class="md2man-permalink" title="permalink"></a></h5><div class="highlight"><pre class="highlight plaintext"><code># Note the use of "stdbuf -oL" to force the program to flush the output line by line.
|
||||
</code></pre></div><h5 id="memory-usage">Memory usage<a name="memory-usage" href="#memory-usage" class="md2man-permalink" title="permalink"></a></h5><div class="highlight"><pre class="highlight plaintext"><code># Note the use of "stdbuf -oL" to force the program to flush the output line by line.
|
||||
execp = new
|
||||
execp_command = stdbuf -oL bwm-ng -o csv -t 1000 | awk -F ';' '/total/ { printf "Net: %.0f Mb/s\n", ($5*8/1.0e6) }; fflush(stdout)'
|
||||
execp_command = free -b -s1 | stdbuf -oL awk '/^Mem:/ { printf "Mem: %s %.0f%%\n", $2, 100 * ($2 - $7) / $2 }' | stdbuf -oL numfmt --to=iec-i --field=2 -d' '
|
||||
execp_interval = 1
|
||||
execp_continuous = 1
|
||||
</code></pre></div><h5 id="network-load">Network load<a name="network-load" href="#network-load" class="md2man-permalink" title="permalink"></a></h5><div class="highlight"><pre class="highlight plaintext"><code>execp = new
|
||||
execp_command = stdbuf -oL bwm-ng -o csv -t 1000 | stdbuf -oL awk -F ';' '/total/ { printf "Net: %.0f Mb/s\n", ($5*8/1.0e6) }'
|
||||
execp_continuous = 1
|
||||
execp_interval = 1
|
||||
</code></pre></div><h3 id="button">Button<a name="button" href="#button" class="md2man-permalink" title="permalink"></a></h3>
|
||||
|
||||
@@ -199,9 +199,9 @@ pre {
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1 id="latest-stable-release-16-7"><span class="md2man-title">Latest</span> <span class="md2man-section">stable</span> <span class="md2man-date">release:</span> <span class="md2man-source">16.7</span><a name="latest-stable-release-16-7" href="#latest-stable-release-16-7" class="md2man-permalink" title="permalink"></a></h1><p>Changes: <a href="https://gitlab.com/o9000/tint2/blob/16.7/ChangeLog">https://gitlab.com/o9000/tint2/blob/16.7/ChangeLog</a></p><p>Documentation: <a href="manual.html">manual.html</a></p><p>Compile it with (after you install the <a href="https://gitlab.com/o9000/tint2/wikis/Install#dependencies">dependencies</a>):</p><div class="highlight"><pre class="highlight plaintext"><code>git clone https://gitlab.com/o9000/tint2.git
|
||||
<h1 id="latest-stable-release-17-0-1"><span class="md2man-title">Latest</span> <span class="md2man-section">stable</span> <span class="md2man-date">release:</span> <span class="md2man-source">17.0.1</span><a name="latest-stable-release-17-0-1" href="#latest-stable-release-17-0-1" class="md2man-permalink" title="permalink"></a></h1><p>Changes: <a href="https://gitlab.com/o9000/tint2/blob/17.0.1/ChangeLog">https://gitlab.com/o9000/tint2/blob/17.0.1/ChangeLog</a></p><p>Documentation: <a href="manual.html">manual.html</a></p><p>Compile it with (after you install the <a href="https://gitlab.com/o9000/tint2/wikis/Install#dependencies">dependencies</a>):</p><div class="highlight"><pre class="highlight plaintext"><code>git clone https://gitlab.com/o9000/tint2.git
|
||||
cd tint2
|
||||
git checkout 16.7
|
||||
git checkout 17.0.1
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.TH TINT2 1 "2019\-07\-14" 16.7
|
||||
.TH TINT2 1 "2021\-05\-29" 17.0.1
|
||||
.SH NAME
|
||||
.PP
|
||||
tint2 \- lightweight panel/taskbar
|
||||
@@ -748,6 +748,8 @@ To hide the clock, comment \fB\fCtime1_format\fR and \fB\fCtime2_format\fR\&.
|
||||
.IP \(bu 2
|
||||
\fB\fCexecp_padding = horizontal_padding vertical_padding spacing_between_icon_and_text\fR \fI(since 0.12.4)\fP
|
||||
.IP \(bu 2
|
||||
\fB\fCexecp_monitor = integer (1, 2, ...), primary or all\fR : On which monitor to draw the executor. The first monitor is \fB\fC1\fR\&. \fI(since 17.0)\fP
|
||||
.IP \(bu 2
|
||||
\fB\fCexecp_lclick_command = text\fR : Command to execute on left click. If not defined, \fB\fCexecp_command\fR is executed immediately, unless it is currently running. \fI(since 0.12.4)\fP
|
||||
.IP \(bu 2
|
||||
\fB\fCexecp_mclick_command = text\fR : Command to execute on right click. If not defined, \fB\fCexecp_command\fR is executed immediately, unless it is currently running. \fI(since 0.12.4)\fP
|
||||
@@ -833,7 +835,7 @@ execp_markup = 1
|
||||
.nf
|
||||
# Note the use of "stdbuf \-oL" to force the program to flush the output line by line.
|
||||
execp = new
|
||||
execp_command = free -b -s1 | stdbuf -oL awk '/^Mem:/ { printf "Mem: %s %.0f%%\n", $2, 100 * ($2 - $7) / $2 }' | stdbuf -oL numfmt --to=iec-i --field=2 -d' '
|
||||
execp_command = free \-b \-s1 | stdbuf \-oL awk '/^Mem:/ { printf "Mem: %s %.0f%%\\n", $2, 100 * ($2 \- $7) / $2 }' | stdbuf \-oL numfmt \-\-to=iec\-i \-\-field=2 \-d' '
|
||||
execp_interval = 1
|
||||
execp_continuous = 1
|
||||
.fi
|
||||
@@ -843,7 +845,7 @@ execp_continuous = 1
|
||||
.RS
|
||||
.nf
|
||||
execp = new
|
||||
execp_command = stdbuf \-oL bwm\-ng \-o csv \-t 1000 | stdbuf -oL awk \-F ';' '/total/ { printf "Net: %.0f Mb/s\\n", ($5*8/1.0e6) }'
|
||||
execp_command = stdbuf \-oL bwm\-ng \-o csv \-t 1000 | stdbuf \-oL awk \-F ';' '/total/ { printf "Net: %.0f Mb/s\\n", ($5*8/1.0e6) }'
|
||||
execp_continuous = 1
|
||||
execp_interval = 1
|
||||
.fi
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# TINT2 1 "2019-07-14" 16.7
|
||||
# TINT2 1 "2021-05-29" 17.0.1
|
||||
|
||||
## NAME
|
||||
tint2 - lightweight panel/taskbar
|
||||
@@ -621,6 +621,8 @@ The action semantics:
|
||||
|
||||
* `execp_padding = horizontal_padding vertical_padding spacing_between_icon_and_text` *(since 0.12.4)*
|
||||
|
||||
* `execp_monitor = integer (1, 2, ...), primary or all` : On which monitor to draw the executor. The first monitor is `1`. *(since 17.0)*
|
||||
|
||||
* `execp_lclick_command = text` : Command to execute on left click. If not defined, `execp_command` is executed immediately, unless it is currently running. *(since 0.12.4)*
|
||||
* `execp_mclick_command = text` : Command to execute on right click. If not defined, `execp_command` is executed immediately, unless it is currently running. *(since 0.12.4)*
|
||||
* `execp_rclick_command = text` : Command to execute on middle click. If not defined, `execp_command` is executed immediately, unless it is currently running. *(since 0.12.4)*
|
||||
|
||||
@@ -6,7 +6,7 @@ Build-Depends: cmake,
|
||||
debhelper (>= 9),
|
||||
libcairo2-dev,
|
||||
libglib2.0-dev,
|
||||
libgtk2.0-dev,
|
||||
libgtk-3-dev,
|
||||
libimlib2-dev,
|
||||
libpango1.0-dev,
|
||||
librsvg2-dev,
|
||||
|
||||
@@ -697,6 +697,9 @@ void add_entry(char *key, char *value)
|
||||
} else {
|
||||
execp->backend->interval = v;
|
||||
}
|
||||
} else if (strcmp(key, "execp_monitor") == 0) {
|
||||
Execp *execp = get_or_create_last_execp();
|
||||
execp->backend->monitor = config_get_monitor(value);
|
||||
} else if (strcmp(key, "execp_has_icon") == 0) {
|
||||
Execp *execp = get_or_create_last_execp();
|
||||
execp->backend->has_icon = atoi(value);
|
||||
|
||||
@@ -43,13 +43,36 @@ Execp *create_execp()
|
||||
execp->backend->cache_icon = TRUE;
|
||||
execp->backend->centered = TRUE;
|
||||
execp->backend->font_color.alpha = 0.5;
|
||||
execp->backend->monitor = -1;
|
||||
INIT_TIMER(execp->backend->timer);
|
||||
execp->backend->bg = &g_array_index(backgrounds, Background, 0);
|
||||
execp->backend->buf_stdout_capacity = 1024;
|
||||
execp->backend->buf_stdout = calloc(execp->backend->buf_stdout_capacity, 1);
|
||||
execp->backend->buf_stderr_capacity = 1024;
|
||||
execp->backend->buf_stderr = calloc(execp->backend->buf_stderr_capacity, 1);
|
||||
execp->backend->text = strdup("");
|
||||
execp->backend->icon_path = NULL;
|
||||
return execp;
|
||||
}
|
||||
|
||||
gpointer create_execp_frontend(gconstpointer arg, gpointer data)
|
||||
{
|
||||
Execp *execp_backend = (Execp *)arg;
|
||||
Panel *panel = data;
|
||||
if (execp_backend->backend->monitor >= 0 &&
|
||||
panel->monitor != execp_backend->backend->monitor) {
|
||||
printf("Skipping executor '%s' with monitor %d for panel on monitor %d\n",
|
||||
execp_backend->backend->command,
|
||||
execp_backend->backend->monitor, panel->monitor);
|
||||
Execp *dummy = create_execp();
|
||||
dummy->frontend = (ExecpFrontend *)calloc(1, sizeof(ExecpFrontend));
|
||||
dummy->backend->instances = g_list_append(dummy->backend->instances, dummy);
|
||||
dummy->dummy = true;
|
||||
return dummy;
|
||||
}
|
||||
printf("Creating executor '%s' with monitor %d for panel on monitor %d\n",
|
||||
execp_backend->backend->command,
|
||||
execp_backend->backend->monitor, panel->monitor);
|
||||
|
||||
Execp *execp_frontend = (Execp *)calloc(1, sizeof(Execp));
|
||||
execp_frontend->backend = execp_backend->backend;
|
||||
@@ -67,7 +90,11 @@ void destroy_execp(void *obj)
|
||||
free_and_null(execp->frontend);
|
||||
remove_area(&execp->area);
|
||||
free_area(&execp->area);
|
||||
free_and_null(execp);
|
||||
if (execp->dummy) {
|
||||
destroy_execp(execp);
|
||||
} else {
|
||||
free_and_null(execp);
|
||||
}
|
||||
} else {
|
||||
// This is a backend element
|
||||
destroy_timer(&execp->backend->timer);
|
||||
@@ -144,12 +171,6 @@ void init_execp()
|
||||
// Set missing config options
|
||||
if (!execp->backend->bg)
|
||||
execp->backend->bg = &g_array_index(backgrounds, Background, 0);
|
||||
execp->backend->buf_stdout_capacity = 1024;
|
||||
execp->backend->buf_stdout = calloc(execp->backend->buf_stdout_capacity, 1);
|
||||
execp->backend->buf_stderr_capacity = 1024;
|
||||
execp->backend->buf_stderr = calloc(execp->backend->buf_stderr_capacity, 1);
|
||||
execp->backend->text = strdup("");
|
||||
execp->backend->icon_path = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,7 +184,7 @@ void init_execp_panel(void *p)
|
||||
|
||||
// panel->execp_list is now a copy of the pointer panel_config.execp_list
|
||||
// We make it a deep copy
|
||||
panel->execp_list = g_list_copy_deep(panel_config.execp_list, create_execp_frontend, NULL);
|
||||
panel->execp_list = g_list_copy_deep(panel_config.execp_list, create_execp_frontend, panel);
|
||||
|
||||
for (GList *l = panel->execp_list; l; l = l->next) {
|
||||
Execp *execp = l->data;
|
||||
|
||||
@@ -24,6 +24,7 @@ typedef struct ExecpBackend {
|
||||
char *command;
|
||||
// Interval in seconds
|
||||
int interval;
|
||||
int monitor;
|
||||
// 1 if first line of output is an icon path
|
||||
gboolean has_icon;
|
||||
gboolean cache_icon;
|
||||
@@ -96,6 +97,7 @@ typedef struct Execp {
|
||||
ExecpBackend *backend;
|
||||
// Set only for frontend Execp items.
|
||||
ExecpFrontend *frontend;
|
||||
bool dummy;
|
||||
} Execp;
|
||||
|
||||
// Called before the config is read and panel_config/panels are created.
|
||||
|
||||
@@ -269,8 +269,9 @@ void init_panel()
|
||||
init_freespace_panel(p);
|
||||
if (panel_items_order[k] == ':')
|
||||
init_separator_panel(p);
|
||||
if (panel_items_order[k] == 'E')
|
||||
if (panel_items_order[k] == 'E') {
|
||||
init_execp_panel(p);
|
||||
}
|
||||
if (panel_items_order[k] == 'P')
|
||||
init_button_panel(p);
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ add_definitions( -DINSTALL_PREFIX=\"${CMAKE_INSTALL_PREFIX}\" )
|
||||
add_definitions( -DLOCALEDIR=\"${CMAKE_INSTALL_FULL_LOCALEDIR}\" )
|
||||
add_definitions( -DGETTEXT_PACKAGE=\"tint2conf\" )
|
||||
add_definitions( -DDGLIB_DISABLE_DEPRECATION_WARNINGS=1 )
|
||||
set_target_properties( tint2conf PROPERTIES COMPILE_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wpointer-arith -fno-strict-aliasing -pthread -std=c99 -Werror-implicit-function-declaration -Wno-deprecated -Wno-deprecated-declarations" )
|
||||
set_target_properties( tint2conf PROPERTIES COMPILE_FLAGS "-Wall -Wpointer-arith -fno-strict-aliasing -pthread -std=c99 -Werror-implicit-function-declaration -Wno-deprecated -Wno-deprecated-declarations" )
|
||||
set_target_properties( tint2conf PROPERTIES LINK_FLAGS "-pthread" )
|
||||
|
||||
add_subdirectory(po)
|
||||
|
||||
@@ -234,10 +234,17 @@ GtkWidget *create_properties()
|
||||
dialog_vbox3 = gtk_dialog_get_content_area(GTK_DIALOG(view));
|
||||
gtk_widget_show(dialog_vbox3);
|
||||
|
||||
GtkWidget *scroll = gtk_scrolled_window_new(NULL, NULL);
|
||||
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll),
|
||||
GTK_POLICY_AUTOMATIC,
|
||||
GTK_POLICY_AUTOMATIC);
|
||||
gtk_box_pack_start(GTK_BOX(dialog_vbox3), scroll, TRUE, TRUE, 1);
|
||||
gtk_widget_show(scroll);
|
||||
|
||||
notebook = gtk_notebook_new();
|
||||
gtk_widget_show(notebook);
|
||||
gtk_container_set_border_width(GTK_CONTAINER(notebook), 5);
|
||||
gtk_box_pack_start(GTK_BOX(dialog_vbox3), notebook, TRUE, TRUE, 6);
|
||||
gtk_container_add(GTK_CONTAINER(scroll), notebook);
|
||||
gtk_notebook_set_tab_pos(GTK_NOTEBOOK(notebook), GTK_POS_LEFT);
|
||||
|
||||
button = gtk_button_new_from_stock("gtk-apply");
|
||||
@@ -4367,6 +4374,31 @@ void create_execp(GtkWidget *notebook, int i)
|
||||
"that print data downloaded from the Internet is a potential security risk."),
|
||||
NULL);
|
||||
|
||||
row++, col = 2;
|
||||
label = gtk_label_new(_("Monitor"));
|
||||
gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
|
||||
gtk_widget_show(label);
|
||||
gtk_table_attach(GTK_TABLE(table), label, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
||||
col++;
|
||||
|
||||
executor->execp_monitor = gtk_combo_box_text_new();
|
||||
gtk_widget_show(executor->execp_monitor);
|
||||
gtk_table_attach(GTK_TABLE(table), executor->execp_monitor, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
||||
col++;
|
||||
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(executor->execp_monitor), _("All"));
|
||||
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(executor->execp_monitor), _("Primary"));
|
||||
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(executor->execp_monitor), _("1"));
|
||||
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(executor->execp_monitor), _("2"));
|
||||
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(executor->execp_monitor), _("3"));
|
||||
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(executor->execp_monitor), _("4"));
|
||||
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(executor->execp_monitor), _("5"));
|
||||
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(executor->execp_monitor), _("6"));
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(executor->execp_monitor), 0);
|
||||
gtk_tooltips_set_tip(tooltips,
|
||||
executor->execp_monitor,
|
||||
_("Specifies the monitor on which to place the executor."),
|
||||
NULL);
|
||||
|
||||
change_paragraph(parent);
|
||||
|
||||
label = gtk_label_new(_("<b>Mouse events</b>"));
|
||||
|
||||
@@ -133,7 +133,7 @@ typedef struct Executor {
|
||||
GtkWidget *page_execp;
|
||||
GtkWidget *page_label;
|
||||
GtkWidget *execp_command, *execp_interval, *execp_has_icon, *execp_cache_icon, *execp_show_tooltip;
|
||||
GtkWidget *execp_continuous, *execp_markup, *execp_tooltip;
|
||||
GtkWidget *execp_continuous, *execp_markup, *execp_tooltip, *execp_monitor;
|
||||
GtkWidget *execp_left_command, *execp_right_command;
|
||||
GtkWidget *execp_mclick_command, *execp_rclick_command, *execp_uwheel_command, *execp_dwheel_command;
|
||||
GtkWidget *execp_font, *execp_font_set, *execp_font_color, *execp_padding_x, *execp_padding_y, *execp_centered;
|
||||
|
||||
@@ -871,6 +871,16 @@ void config_write_execp(FILE *fp)
|
||||
fprintf(fp,
|
||||
"execp_markup = %d\n",
|
||||
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(executor->execp_markup)) ? 1 : 0);
|
||||
fprintf(fp, "execp_monitor = ");
|
||||
if (gtk_combo_box_get_active(GTK_COMBO_BOX(executor->execp_monitor)) <= 0) {
|
||||
fprintf(fp, "all");
|
||||
} else if (gtk_combo_box_get_active(GTK_COMBO_BOX(executor->execp_monitor)) == 1) {
|
||||
fprintf(fp, "primary");
|
||||
} else {
|
||||
fprintf(fp, "%d", MAX(1, gtk_combo_box_get_active(GTK_COMBO_BOX(executor->execp_monitor)) - 1));
|
||||
}
|
||||
fprintf(fp, "\n");
|
||||
|
||||
if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(executor->execp_show_tooltip))) {
|
||||
fprintf(fp, "execp_tooltip = \n");
|
||||
} else {
|
||||
@@ -1964,6 +1974,23 @@ void add_entry(char *key, char *value)
|
||||
gtk_spin_button_set_value(GTK_SPIN_BUTTON(execp_get_last()->execp_continuous), atoi(value));
|
||||
} else if (strcmp(key, "execp_markup") == 0) {
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(execp_get_last()->execp_markup), atoi(value));
|
||||
} else if (strcmp(key, "execp_monitor") == 0) {
|
||||
if (strcmp(value, "all") == 0)
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(execp_get_last()->execp_monitor), 0);
|
||||
else if (strcmp(value, "primary") == 0)
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(execp_get_last()->execp_monitor), 1);
|
||||
else if (strcmp(value, "1") == 0)
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(execp_get_last()->execp_monitor), 2);
|
||||
else if (strcmp(value, "2") == 0)
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(execp_get_last()->execp_monitor), 3);
|
||||
else if (strcmp(value, "3") == 0)
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(execp_get_last()->execp_monitor), 4);
|
||||
else if (strcmp(value, "4") == 0)
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(execp_get_last()->execp_monitor), 5);
|
||||
else if (strcmp(value, "5") == 0)
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(execp_get_last()->execp_monitor), 6);
|
||||
else if (strcmp(value, "6") == 0)
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(execp_get_last()->execp_monitor), 7);
|
||||
} else if (strcmp(key, "execp_tooltip") == 0) {
|
||||
if (strlen(value) > 0) {
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(execp_get_last()->execp_show_tooltip), 1);
|
||||
|
||||
@@ -794,8 +794,8 @@ Imlib_Image load_image(const char *path, int cached)
|
||||
static unsigned long counter = 0;
|
||||
if (debug_icons)
|
||||
fprintf(stderr, "tint2: loading icon %s\n", path);
|
||||
#ifdef HAVE_RSVG
|
||||
image = imlib_load_image(path);
|
||||
#ifdef HAVE_RSVG
|
||||
if (!image && g_str_has_suffix(path, ".svg")) {
|
||||
char tmp_filename[128];
|
||||
snprintf(tmp_filename, sizeof(tmp_filename), "/tmp/tint2-%d-%lu.png", (int)getpid(), counter);
|
||||
@@ -825,11 +825,8 @@ Imlib_Image load_image(const char *path, int cached)
|
||||
unlink(tmp_filename);
|
||||
}
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
image = imlib_load_image(path);
|
||||
}
|
||||
#endif
|
||||
imlib_context_set_image(image);
|
||||
imlib_image_set_changes_on_disk();
|
||||
return image;
|
||||
|
||||
@@ -85,7 +85,6 @@ static void sigchld_handler(int sig)
|
||||
int savedErrno = errno;
|
||||
ssize_t unused = write(sigchild_pipe[1], "x", 1);
|
||||
(void)unused;
|
||||
fsync(sigchild_pipe[1]);
|
||||
errno = savedErrno;
|
||||
}
|
||||
|
||||
|
||||
@@ -131,7 +131,8 @@ struct timeval *get_duration_to_next_timer_expiration()
|
||||
next_timer->expiration_time_ms_,
|
||||
next_timer->period_ms_);
|
||||
result.tv_sec = duration / 1000;
|
||||
result.tv_usec = 1000 * (duration - result.tv_sec);
|
||||
duration -= result.tv_sec * 1000;
|
||||
result.tv_usec = 1000 * duration;
|
||||
return &result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user