mirror of
https://github.com/davatorium/rofi.git
synced 2025-01-27 15:25:24 -05:00
Small fix.
This commit is contained in:
parent
dc5c853d91
commit
f033a0d669
3 changed files with 10 additions and 5 deletions
|
@ -81,8 +81,9 @@ static char ** get_profile ( )
|
||||||
if ( getenv( "HOME" ) == NULL ) return NULL;
|
if ( getenv( "HOME" ) == NULL ) return NULL;
|
||||||
|
|
||||||
const char *hd = getenv( "HOME" );
|
const char *hd = getenv( "HOME" );
|
||||||
path = allocate( strlen( hd ) + strlen( ".switch_profile.conf" )+3 );
|
unsigned int path_length = strlen( hd ) + strlen( ".switch_profile.conf" )+3;
|
||||||
sprintf( path, "%s/%s", hd, ".switch_profile.conf" );
|
path = allocate( path_length );
|
||||||
|
snprintf( path, path_length, "%s/%s", hd, ".switch_profile.conf" );
|
||||||
FILE *fd = fopen ( path, "r" );
|
FILE *fd = fopen ( path, "r" );
|
||||||
|
|
||||||
if ( fd != NULL ) {
|
if ( fd != NULL ) {
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <err.h>
|
#include <err.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <time.h>
|
||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
#include <X11/Xatom.h>
|
#include <X11/Xatom.h>
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
|
@ -432,7 +433,9 @@ int take_keyboard( Window w )
|
||||||
if ( XGrabKeyboard( display, w, True, GrabModeAsync, GrabModeAsync, CurrentTime ) == GrabSuccess )
|
if ( XGrabKeyboard( display, w, True, GrabModeAsync, GrabModeAsync, CurrentTime ) == GrabSuccess )
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
usleep( 1000 );
|
|
||||||
|
struct timespec rsl = { 1, 0L };
|
||||||
|
nanosleep(&rsl, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -88,8 +88,9 @@ static pid_t exec_cmd( const char *cmd, int run_in_term )
|
||||||
* This happens in non-critical time (After launching app)
|
* This happens in non-critical time (After launching app)
|
||||||
* It is allowed to be a bit slower.
|
* It is allowed to be a bit slower.
|
||||||
*/
|
*/
|
||||||
char *path = allocate( strlen( cache_dir ) + strlen( RUN_CACHE_FILE )+3 );
|
size_t path_length = strlen( cache_dir ) + strlen( RUN_CACHE_FILE )+3;
|
||||||
sprintf( path, "%s/%s", cache_dir, RUN_CACHE_FILE );
|
char *path = allocate( path_length );
|
||||||
|
snprintf( path, path_length, "%s/%s", cache_dir, RUN_CACHE_FILE );
|
||||||
FILE *fd = fopen ( path, "r" );
|
FILE *fd = fopen ( path, "r" );
|
||||||
|
|
||||||
if ( fd != NULL ) {
|
if ( fd != NULL ) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue