separate folders better
This commit is contained in:
@@ -176,14 +176,17 @@ class entry_collection:
|
||||
continue
|
||||
row = row.strip().split(':',1)
|
||||
if len(row) == 1:
|
||||
row = [ "$" + row[0].strip(), row[0] ]
|
||||
row = [ row[0].strip(), row[0] ]
|
||||
else:
|
||||
row = [ row[0].strip(), row[1] ]
|
||||
launcher = "menu"
|
||||
if row[1][-1] == '/' and os.path.isdir(row[1]):
|
||||
launcher = "dir"
|
||||
self.entries.append(
|
||||
launch_item(
|
||||
command = row[1],
|
||||
description = row[0],
|
||||
launcher = "menu"
|
||||
launcher = launcher
|
||||
)
|
||||
)
|
||||
|
||||
@@ -407,12 +410,15 @@ class entry_collection:
|
||||
|
||||
bg = False
|
||||
idx = self.menu_keys.index(key)
|
||||
chdir = False
|
||||
if self.dir_mode:
|
||||
command_str = self.dirs[idx].command
|
||||
chdir = True
|
||||
else:
|
||||
command_str = self.entries[idx].command
|
||||
chdir = self.entries[idx].launcher == "dir"
|
||||
|
||||
if self.dir_mode or command_str[-1] == '/':
|
||||
if chdir:
|
||||
if os.path.isdir(command_str):
|
||||
os.chdir(command_str)
|
||||
self.selected = -1
|
||||
|
||||
Reference in New Issue
Block a user