New_wins = get_wins(all_pids) # Snapshot of windows open Time.sleep(WINDOW_TIME) # Give time for window to appear Print('launch_command() ERROR: A new PID could not be found') Pid_list = list(set(new_pids) - set(all_pids)) Print('launch_ext_command() ERROR: max sleep count reached') If sleep_count = 1000: # 10 second time-out If sleep_count > 0: # Don't sleep first time through loop New_pids = get_pids(ext_name) # Snapshot current PID list While new_pids = all_pids: # Loop until new PID is assigned Os.popen(ext_name) # Run command in background Sleep_count = 0 # Counter to prevent infinite loops 2 seconds to run.Īll_pids = get_pids(ext_name) # Snapshot current PID listĪll_wins = get_wins(all_pids) # Snapshot of windows open ''' Launch external command in background and return PID to parent. # Launch in background and get window ID openedĪctive_pid, active_win = launch_command(command) """ NOTE: To discover window coordinates, arrange on desktop and type: # 'move 3849 2266', # triple monitor setup 'title Ask\ Ubuntu', # Window title (escape spaces) 'xdotool type "cd ~/askubuntu"', # Change to working directory 'xdotool key Control_L+Shift_L+T', # Open new terminal tab 'title SSH\ Activity', # Window title (escape spaces) 'xdotool type "./ssh-activity"', # Suspend after 15 minutes 'xdotool type "cd ~"', # Change to home directory # 'move 2100 1000', # triple monitor setup 'sleep '+str(BASHRC_TIME), # Bash command wait a sec 5 # Secpmds fpr window to appearĬommands = [ 'gnome-terminal &', # Launch terminal in background # dellstart - Autostart GUI applications on Dell Fileserverįrom _future_ import print_function # Must be first importīASHRC_TIME = 2 # Seconds to load ~/.bashrc The python program: #!/usr/bin/env python
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |