mirror of
				https://github.com/ItsDrike/dotfiles.git
				synced 2025-11-04 09:16:36 +00:00 
			
		
		
		
	Merge branch 'arch' into gentoo
This commit is contained in:
		
						commit
						28ccb08d65
					
				
					 1 changed files with 11 additions and 0 deletions
				
			
		
							
								
								
									
										11
									
								
								home/.local/bin/scripts/deskopen
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										11
									
								
								home/.local/bin/scripts/deskopen
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,11 @@
 | 
			
		|||
#!/bin/sh
 | 
			
		||||
 | 
			
		||||
# Find the line with exec, if there's multiple lines
 | 
			
		||||
# use the last one
 | 
			
		||||
exec_line=$(grep '^Exec' "$1" | tail -1)
 | 
			
		||||
# Remove 'Exec' and arguments (%u, %f, ...)
 | 
			
		||||
cmd=$(echo $exec_line | sed 's/^Exec=//' | sed 's/%.//')
 | 
			
		||||
# Remove "" around command (if present)
 | 
			
		||||
cmd=$(echo $cmd | sed 's/^"//g' | sed 's/" *$//g')
 | 
			
		||||
# Run the exec line of the application in the background
 | 
			
		||||
$($cmd) &
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue