Fixes rofi shutdown command
I use an alias rather than an expanded variable so I can include an empty parameter. The rofi shutdown command now only needs a single click to select an option
This commit is contained in:
		
							parent
							
								
									f2fa4b258e
								
							
						
					
					
						commit
						a6e3cd71d4
					
				
					 1 changed files with 4 additions and 5 deletions
				
			
		| 
						 | 
					@ -1,13 +1,13 @@
 | 
				
			||||||
#!/usr/bin/sh
 | 
					#!/usr/bin/sh
 | 
				
			||||||
if type -p rofi 2> /dev/null; then
 | 
					if type -p rofi 2> /dev/null; then
 | 
				
			||||||
	selectcommand="rofi -dmenu -i -theme themes/four.rasi -me-select-entry '' -me-accept-entry 'Mouse1'"
 | 
						alias selectcommand="rofi -dmenu -i -theme themes/four.rasi -me-select-entry '' -me-accept-entry MousePrimary"
 | 
				
			||||||
	shutdown=""
 | 
						shutdown=""
 | 
				
			||||||
	reboot=""
 | 
						reboot=""
 | 
				
			||||||
	lock=""
 | 
						lock=""
 | 
				
			||||||
	suspend=""
 | 
						suspend=""
 | 
				
			||||||
	logout=""
 | 
						logout=""
 | 
				
			||||||
else
 | 
					else
 | 
				
			||||||
	selectcommand="dmenu -i -p 'Option'"
 | 
						alias selectcommand="dmenu -i -p 'Option'"
 | 
				
			||||||
	shutdown="Shutdown"
 | 
						shutdown="Shutdown"
 | 
				
			||||||
	reboot="Reboot"
 | 
						reboot="Reboot"
 | 
				
			||||||
	lock="Lock"
 | 
						lock="Lock"
 | 
				
			||||||
| 
						 | 
					@ -17,8 +17,7 @@ fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
selection=$( \
 | 
					selection=$( \
 | 
				
			||||||
	#echo -e "$shutdown\n$reboot\n$lock\n$suspend\n$logout" | $selectcommand
 | 
						echo -e "$shutdown\n$reboot\n$lock\n$logout\n$suspend" | selectcommand
 | 
				
			||||||
	echo -e "$shutdown\n$reboot\n$lock\n$suspend" | $selectcommand
 | 
					 | 
				
			||||||
	);
 | 
						);
 | 
				
			||||||
echo $selection;
 | 
					echo $selection;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue