mirror of
https://github.com/davatorium/rofi.git
synced 2024-11-18 13:54:36 -05:00
Indent + ChangeLog
This commit is contained in:
parent
98de9b554f
commit
61738f881f
2 changed files with 22 additions and 22 deletions
|
@ -8,7 +8,8 @@
|
||||||
- Disabled by default.
|
- Disabled by default.
|
||||||
- Highlight multiple selected rows (#287,#293)
|
- Highlight multiple selected rows (#287,#293)
|
||||||
- Dmenu can read from file instead of stdin.
|
- Dmenu can read from file instead of stdin.
|
||||||
- Regex matching (#113)
|
- Regex matching (#113)
|
||||||
|
- Take Screenshot of rofi using keybinding.
|
||||||
Improvements:
|
Improvements:
|
||||||
- Update manpage (#289, #291)
|
- Update manpage (#289, #291)
|
||||||
- Improve speed of reading stdin in dmenu mode.
|
- Improve speed of reading stdin in dmenu mode.
|
||||||
|
|
|
@ -576,41 +576,41 @@ static void menu_capture_screenshot ( void )
|
||||||
int index = 0;
|
int index = 0;
|
||||||
if ( surface == NULL ) {
|
if ( surface == NULL ) {
|
||||||
// Nothing to store.
|
// Nothing to store.
|
||||||
fprintf(stderr, "There is no rofi surface to store\n");
|
fprintf ( stderr, "There is no rofi surface to store\n" );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const char *xdg_pict_dir = g_get_user_special_dir(G_USER_DIRECTORY_PICTURES);
|
const char *xdg_pict_dir = g_get_user_special_dir ( G_USER_DIRECTORY_PICTURES );
|
||||||
if ( xdg_pict_dir == NULL ) {
|
if ( xdg_pict_dir == NULL ) {
|
||||||
fprintf(stderr, "XDG user picture directory is not set. Cannot store screenshot.\n");
|
fprintf ( stderr, "XDG user picture directory is not set. Cannot store screenshot.\n" );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Get current time.
|
// Get current time.
|
||||||
GDateTime *now = g_date_time_new_now_local();
|
GDateTime *now = g_date_time_new_now_local ();
|
||||||
// Format filename.
|
// Format filename.
|
||||||
char *timestmp = g_date_time_format(now, "rofi-%Y-%m-%d-%H:%M");
|
char *timestmp = g_date_time_format ( now, "rofi-%Y-%m-%d-%H:%M" );
|
||||||
char *filename = g_strdup_printf("%s.png", timestmp);
|
char *filename = g_strdup_printf ( "%s.png", timestmp );
|
||||||
// Build full path
|
// Build full path
|
||||||
char *fpath = g_build_filename(xdg_pict_dir, filename, NULL);
|
char *fpath = g_build_filename ( xdg_pict_dir, filename, NULL );
|
||||||
while(g_file_test(fpath, G_FILE_TEST_EXISTS) && index < 99) {
|
while ( g_file_test ( fpath, G_FILE_TEST_EXISTS ) && index < 99 ) {
|
||||||
g_free(fpath);
|
g_free ( fpath );
|
||||||
g_free(filename);
|
g_free ( filename );
|
||||||
// Try the next index.
|
// Try the next index.
|
||||||
index++;
|
index++;
|
||||||
// Format filename.
|
// Format filename.
|
||||||
filename = g_strdup_printf("%s-%d.png", timestmp,index);
|
filename = g_strdup_printf ( "%s-%d.png", timestmp, index );
|
||||||
// Build full path
|
// Build full path
|
||||||
fpath = g_build_filename(xdg_pict_dir, filename, NULL);
|
fpath = g_build_filename ( xdg_pict_dir, filename, NULL );
|
||||||
}
|
}
|
||||||
fprintf(stderr, color_green"Storing screenshot %s\n"color_reset,fpath);
|
fprintf ( stderr, color_green "Storing screenshot %s\n"color_reset, fpath );
|
||||||
cairo_status_t status = cairo_surface_write_to_png(surface, fpath);
|
cairo_status_t status = cairo_surface_write_to_png ( surface, fpath );
|
||||||
if ( status != CAIRO_STATUS_SUCCESS ) {
|
if ( status != CAIRO_STATUS_SUCCESS ) {
|
||||||
fprintf(stderr, "Failed to produce screenshot '%s', got error: '%s'\n",filename,
|
fprintf ( stderr, "Failed to produce screenshot '%s', got error: '%s'\n", filename,
|
||||||
cairo_status_to_string(status));
|
cairo_status_to_string ( status ) );
|
||||||
}
|
}
|
||||||
g_free(fpath);
|
g_free ( fpath );
|
||||||
g_free(filename);
|
g_free ( filename );
|
||||||
g_free(timestmp);
|
g_free ( timestmp );
|
||||||
g_date_time_unref(now);
|
g_date_time_unref ( now );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1689,7 +1689,6 @@ MenuReturn menu ( Mode *sw, char **input, char *prompt, unsigned int *selected_l
|
||||||
return retv;
|
return retv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void error_dialog ( const char *msg, int markup )
|
void error_dialog ( const char *msg, int markup )
|
||||||
{
|
{
|
||||||
MenuState state = {
|
MenuState state = {
|
||||||
|
|
Loading…
Reference in a new issue