mirror of
https://github.com/davatorium/rofi.git
synced 2024-11-11 13:50:48 -05:00
Remove duplicate variable, revert earlier change.
This commit is contained in:
parent
95dd228dd6
commit
9f4078cec8
1 changed files with 61 additions and 76 deletions
|
@ -1271,28 +1271,6 @@ void help()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int program_end()
|
|
||||||
{
|
|
||||||
if ( display != NULL ) {
|
|
||||||
|
|
||||||
if ( main_window != None ) {
|
|
||||||
XFreeGC( display,gc );
|
|
||||||
XDestroyWindow( display,main_window );
|
|
||||||
XCloseDisplay( display );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
winlist_free( cache_xattr );
|
|
||||||
winlist_free( cache_client );
|
|
||||||
#ifdef I3
|
|
||||||
|
|
||||||
if ( i3_socket_path != NULL ) free( i3_socket_path );
|
|
||||||
|
|
||||||
#endif
|
|
||||||
return EXIT_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int main( int argc, char *argv[] )
|
int main( int argc, char *argv[] )
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
|
@ -1331,31 +1309,29 @@ int main( int argc, char *argv[] )
|
||||||
|
|
||||||
XFreeModifiermap( modmap );
|
XFreeModifiermap( modmap );
|
||||||
|
|
||||||
int ac = argc;
|
|
||||||
char **av = argv;
|
|
||||||
cache_client = winlist_new();
|
cache_client = winlist_new();
|
||||||
cache_xattr = winlist_new();
|
cache_xattr = winlist_new();
|
||||||
|
|
||||||
// X atom values
|
// X atom values
|
||||||
for ( i = 0; i < NETATOMS; i++ ) netatoms[i] = XInternAtom( display, netatom_names[i], False );
|
for ( i = 0; i < NETATOMS; i++ ) netatoms[i] = XInternAtom( display, netatom_names[i], False );
|
||||||
|
|
||||||
find_arg_str( ac, av, "-font", &( config.menu_font ) );
|
find_arg_str( argc, argv, "-font", &( config.menu_font ) );
|
||||||
find_arg_str( ac, av, "-fg", &( config.menu_fg ) );
|
find_arg_str( argc, argv, "-fg", &( config.menu_fg ) );
|
||||||
find_arg_str( ac, av, "-bg", &( config.menu_bg ) );
|
find_arg_str( argc, argv, "-bg", &( config.menu_bg ) );
|
||||||
find_arg_str( ac, av, "-bgalt", &( config.menu_bgalt ) );
|
find_arg_str( argc, argv, "-bgalt", &( config.menu_bgalt ) );
|
||||||
find_arg_str( ac, av, "-hlfg", &( config.menu_hlfg ) );
|
find_arg_str( argc, argv, "-hlfg", &( config.menu_hlfg ) );
|
||||||
find_arg_str( ac, av, "-hlbg", &( config.menu_hlbg ) );
|
find_arg_str( argc, argv, "-hlbg", &( config.menu_hlbg ) );
|
||||||
find_arg_str( ac, av, "-bc", &( config.menu_bc ) );
|
find_arg_str( argc, argv, "-bc", &( config.menu_bc ) );
|
||||||
|
|
||||||
find_arg_str( ac, av, "-term", &( config.terminal_emulator ) );
|
find_arg_str( argc, argv, "-term", &( config.terminal_emulator ) );
|
||||||
|
|
||||||
config.zeltak_mode = ( find_arg( ac, av, "-zeltak" ) >= 0 );
|
config.zeltak_mode = ( find_arg( argc, argv, "-zeltak" ) >= 0 );
|
||||||
|
|
||||||
|
|
||||||
find_arg_int( ac, av, "-bw", &( config.menu_bw ) );
|
find_arg_int( argc, argv, "-bw", &( config.menu_bw ) );
|
||||||
find_arg_int( ac, av, "-o", &( config.window_opacity ) );
|
find_arg_int( argc, argv, "-o", &( config.window_opacity ) );
|
||||||
find_arg_int( ac, av, "-width",&( config.menu_width ) );
|
find_arg_int( argc, argv, "-width",&( config.menu_width ) );
|
||||||
find_arg_int( ac, av, "-lines",&( config.menu_lines ) );
|
find_arg_int( argc, argv, "-lines",&( config.menu_lines ) );
|
||||||
|
|
||||||
#ifdef I3
|
#ifdef I3
|
||||||
// Check for i3
|
// Check for i3
|
||||||
|
@ -1376,26 +1352,18 @@ int main( int argc, char *argv[] )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// flags to run immediately and exit
|
// flags to run immediately and exit
|
||||||
if ( find_arg( ac, av, "-now" ) >= 0 ) {
|
if ( find_arg( argc, argv, "-now" ) >= 0 ) {
|
||||||
run_switcher( NOFORK, WINDOW_SWITCHER );
|
run_switcher( NOFORK, WINDOW_SWITCHER );
|
||||||
return program_end();
|
} else if ( find_arg( argc, argv, "-rnow" ) >= 0 ) {
|
||||||
}
|
|
||||||
|
|
||||||
if ( find_arg( ac, av, "-rnow" ) >= 0 ) {
|
|
||||||
run_switcher( NOFORK, RUN_DIALOG );
|
run_switcher( NOFORK, RUN_DIALOG );
|
||||||
return program_end();
|
} else if ( find_arg( argc, argv, "-snow" ) >= 0 ) {
|
||||||
}
|
|
||||||
|
|
||||||
if ( find_arg( ac, av, "-snow" ) >= 0 ) {
|
|
||||||
run_switcher( NOFORK, SSH_DIALOG );
|
run_switcher( NOFORK, SSH_DIALOG );
|
||||||
return program_end();
|
} else {
|
||||||
}
|
// Daemon mode, Listen to key presses..
|
||||||
|
|
||||||
// key combination to display all windows from all desktops
|
find_arg_str( argc, argv, "-key", &( config.window_key ) );
|
||||||
|
find_arg_str( argc, argv, "-rkey",&( config.run_key ) );
|
||||||
find_arg_str( ac, av, "-key", &( config.window_key ) );
|
find_arg_str( argc, argv, "-skey",&( config.ssh_key ) );
|
||||||
find_arg_str( ac, av, "-rkey",&( config.run_key ) );
|
|
||||||
find_arg_str( ac, av, "-skey",&( config.ssh_key ) );
|
|
||||||
|
|
||||||
parse_key( config.window_key, &windows_modmask, &windows_keysym );
|
parse_key( config.window_key, &windows_modmask, &windows_keysym );
|
||||||
parse_key( config.run_key, &rundialog_modmask, &rundialog_keysym );
|
parse_key( config.run_key, &rundialog_modmask, &rundialog_keysym );
|
||||||
|
@ -1420,6 +1388,23 @@ int main( int argc, char *argv[] )
|
||||||
|
|
||||||
if ( ev.type == KeyPress ) handle_keypress( &ev );
|
if ( ev.type == KeyPress ) handle_keypress( &ev );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
// Cleanup
|
||||||
|
if ( display != NULL ) {
|
||||||
|
|
||||||
return program_end();
|
if ( main_window != None ) {
|
||||||
|
XFreeGC( display,gc );
|
||||||
|
XDestroyWindow( display,main_window );
|
||||||
|
XCloseDisplay( display );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
winlist_free( cache_xattr );
|
||||||
|
winlist_free( cache_client );
|
||||||
|
#ifdef I3
|
||||||
|
|
||||||
|
if ( i3_socket_path != NULL ) free( i3_socket_path );
|
||||||
|
|
||||||
|
#endif
|
||||||
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue