xqq: add "open homepage" action
This commit is contained in:
		
							parent
							
								
									bbb6368e8c
								
							
						
					
					
						commit
						81d73d6363
					
				
					 1 changed files with 13 additions and 2 deletions
				
			
		
							
								
								
									
										15
									
								
								void/xqq
									
										
									
									
									
								
							
							
						
						
									
										15
									
								
								void/xqq
									
										
									
									
									
								
							|  | @ -1,6 +1,16 @@ | |||
| #!/bin/zsh | ||||
| 
 | ||||
| zparseopts -D -E i=installed -installed=installed | ||||
| zparseopts -D -E i=installed -installed=installed h=help -help=help | ||||
| 
 | ||||
| if [[ $help ]]; then | ||||
| 	<<-HELP | ||||
| 	xqq: interactive xbps-query | ||||
| 	 | ||||
| 	Options: | ||||
| 		-i, --installed: only show installed packages | ||||
| 	HELP | ||||
| 	exit | ||||
| fi | ||||
| 
 | ||||
| if [[ $installed ]]; then | ||||
| 	filter-installed() { | ||||
|  | @ -30,7 +40,7 @@ colored_description=$(mktemp) | |||
| }| sed -e 's/^\([^:]*:\)/\x1B[33m\1\x1B[0m/' > $colored_description | ||||
| 
 | ||||
| action=$( | ||||
| 	printf "%s\n" details install remove hold unhold 'list files' 'set to auto' 'set to manual'| fzf --header "Actions for $package" --preview "cat $colored_description" | ||||
| 	printf "%s\n" details install remove hold unhold 'list files' 'open homepage' 'set to auto' 'set to manual'| fzf --header "Actions for $package" --preview "cat $colored_description" | ||||
| ) | ||||
| 
 | ||||
| case $action in | ||||
|  | @ -40,6 +50,7 @@ case $action in | |||
| 	hold) sudo xbps-pkgdb -m hold $package ;; | ||||
| 	unhold) sudo xbps-pkgdb -m unhold $package ;; | ||||
| 	'list files') xbps-query -Rf $package ;; | ||||
| 	'open homepage') xbps-query -Rp homepage $package | xargs xdg-open;; | ||||
| 	'set to auto') sudo xbps-pkgdb -m auto $package ;; | ||||
| 	'set to manual') sudo xbps-pkgdb -m manual $package ;; | ||||
| 	*) echo "unknown action: $action" | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 crater2150
						crater2150