mirror of https://github.com/davatorium/rofi.git
Make things behave nice again in i3.
This commit is contained in:
parent
1834e25ef3
commit
8a3daf3194
|
@ -53,8 +53,10 @@ Settings config = {
|
||||||
.zeltak_mode = 0,
|
.zeltak_mode = 0,
|
||||||
// Terminal to use. (for ssh and open in terminal)
|
// Terminal to use. (for ssh and open in terminal)
|
||||||
.terminal_emulator = "x-terminal-emulator",
|
.terminal_emulator = "x-terminal-emulator",
|
||||||
|
#ifdef I3
|
||||||
// Auto-detected. no longer used.
|
// Auto-detected. no longer used.
|
||||||
.i3_mode = 0,
|
.i3_mode = 0,
|
||||||
|
#endif
|
||||||
// Key binding
|
// Key binding
|
||||||
.window_key = "F12",
|
.window_key = "F12",
|
||||||
.run_key = "mod1+F2",
|
.run_key = "mod1+F2",
|
||||||
|
|
|
@ -90,7 +90,9 @@ typedef struct _Settings {
|
||||||
// Behavior
|
// Behavior
|
||||||
unsigned int zeltak_mode;
|
unsigned int zeltak_mode;
|
||||||
char * terminal_emulator;
|
char * terminal_emulator;
|
||||||
|
#ifdef I3
|
||||||
unsigned int i3_mode;
|
unsigned int i3_mode;
|
||||||
|
#endif
|
||||||
// Key bindings
|
// Key bindings
|
||||||
char * window_key;
|
char * window_key;
|
||||||
char * run_key;
|
char * run_key;
|
||||||
|
|
|
@ -1201,7 +1201,15 @@ SwitcherMode run_switcher_window ( char **input )
|
||||||
// Create pattern for printing the line.
|
// Create pattern for printing the line.
|
||||||
if (!window_get_cardinal_prop(root, netatoms[_NET_NUMBER_OF_DESKTOPS], &desktops, 1))
|
if (!window_get_cardinal_prop(root, netatoms[_NET_NUMBER_OF_DESKTOPS], &desktops, 1))
|
||||||
desktops = 1;
|
desktops = 1;
|
||||||
sprintf(pattern, "%%-%ds %%-%ds %%s", desktops < 10 ? 1 : 2, MAX(5, classfield));
|
#ifdef I3
|
||||||
|
if(config.i3_mode) {
|
||||||
|
sprintf(pattern, "%%-%ds %%s", MAX(5, classfield));
|
||||||
|
}else {
|
||||||
|
#endif
|
||||||
|
sprintf(pattern, "%%-%ds %%-%ds %%s", desktops < 10 ? 1 : 2, MAX(5, classfield));
|
||||||
|
#ifdef I3
|
||||||
|
}
|
||||||
|
#endif
|
||||||
char **list = allocate_clear( sizeof( char* ) * ( ids->len+1 ) );
|
char **list = allocate_clear( sizeof( char* ) * ( ids->len+1 ) );
|
||||||
int lines = 0;
|
int lines = 0;
|
||||||
|
|
||||||
|
@ -1216,16 +1224,23 @@ SwitcherMode run_switcher_window ( char **input )
|
||||||
char desktop[5];
|
char desktop[5];
|
||||||
desktop[0] = 0;
|
desktop[0] = 0;
|
||||||
char *line = allocate( strlen( c->title ) + strlen( c->class ) + classfield + 50 );
|
char *line = allocate( strlen( c->title ) + strlen( c->class ) + classfield + 50 );
|
||||||
|
#ifdef I3
|
||||||
|
if(!config.i3_mode) {
|
||||||
|
#endif
|
||||||
|
// find client's desktop. this is zero-based, so we adjust by since most
|
||||||
|
// normal people don't think like this :-)
|
||||||
|
if (!window_get_cardinal_prop(c->window, netatoms[_NET_WM_DESKTOP], &wmdesktop, 1))
|
||||||
|
wmdesktop = 0xFFFFFFFF;
|
||||||
|
|
||||||
// find client's desktop. this is zero-based, so we adjust by since most
|
if (wmdesktop < 0xFFFFFFFF)
|
||||||
// normal people don't think like this :-)
|
sprintf(desktop, "%d", (int)wmdesktop+1);
|
||||||
if (!window_get_cardinal_prop(c->window, netatoms[_NET_WM_DESKTOP], &wmdesktop, 1))
|
|
||||||
wmdesktop = 0xFFFFFFFF;
|
|
||||||
|
|
||||||
if (wmdesktop < 0xFFFFFFFF)
|
sprintf(line, pattern, desktop, c->class, c->title);
|
||||||
sprintf(desktop, "%d", (int)wmdesktop+1);
|
#ifdef I3
|
||||||
|
}else{
|
||||||
sprintf(line, pattern, desktop, c->class, c->title);
|
sprintf(line, pattern, c->class, c->title);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
list[lines++] = line;
|
list[lines++] = line;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue