Commits

Smith Dhumbumroong  committed 2b2dce4

Add ability to specify logout command.

  • Participants
  • Parent commits fdd6346

Comments (0)

Files changed (1)

File PyShutdownBox.py

         # define sections name
         command_run = 'Command to run before shutdown'
         process_list = 'List of process to close before shutdown, separated by comma'
+        logout_command = 'Command used to logout'
 
         config = ConfigParser.RawConfigParser()
 
             config.read(config_file)
 
             self.rc_shutdown = config.get(command_run, 'command')
-            self.plist = config.get(process_list, 'process list')
+            self.plist = config.get(process_list, 'process_list')
+            self.logout_cmd = config.get(logout_command, 'logout_command')
 
         else:
             if not os.path.isdir(config_dir):
             config.set(command_run, 'command', 'None')
 
             config.add_section(process_list)
-            config.set(process_list, 'process list', 'None')
+            config.set(process_list, 'process_list', 'None')
+
+            config.add_section(logout_command)
+            config.set(process_list, 'logout_command', 'None')
 
             with open(config_file, 'wb') as configfile:
                 config.write(configfile)
             os.system(self.rc_shutdown)
         self.CloseProcesses(self.plist)
 
-        pman = ProcessManager()
-        pman.pkill('openbox')
+        os.system(self.logout_cmd)
 
     def restart(self, widget):
         if not self.rc_shutdown == 'None':