fixed calcurse syncing script for polybar
This commit is contained in:
		
							parent
							
								
									efd91f41d2
								
							
						
					
					
						commit
						33e21b2be8
					
				
							
								
								
									
										16
									
								
								bin/calcurse-sync.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										16
									
								
								bin/calcurse-sync.sh
									
									
									
									
									
										Executable file
									
								
							@ -0,0 +1,16 @@
 | 
			
		||||
#!/bin/bash
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
OUTPUT=$(CALCURSE_CALDAV_PASSWORD=$(pass show cal.keegandeppe.com/kdeppe 2>&1) calcurse-caldav 2>&1)
 | 
			
		||||
ERRORS=$(echo "$OUTPUT" | grep error)
 | 
			
		||||
 | 
			
		||||
if [ -n "$ERRORS" ] ; then
 | 
			
		||||
    polybar-msg action calendar-sync hook 2 1>/dev/null
 | 
			
		||||
    exit 0
 | 
			
		||||
fi
 | 
			
		||||
    
 | 
			
		||||
# success, show green for a few seconds and quit
 | 
			
		||||
polybar-msg action calendar-sync hook 1 1>/dev/null
 | 
			
		||||
sleep 3
 | 
			
		||||
polybar-msg action calendar-sync hook 0 1>/dev/null
 | 
			
		||||
    exit 0
 | 
			
		||||
@ -238,10 +238,13 @@ exec = PERCENTAGE=true g703monitor.sh
 | 
			
		||||
 | 
			
		||||
[module/calendar-sync]
 | 
			
		||||
; clickable sync for calendar
 | 
			
		||||
type = custom/script
 | 
			
		||||
type = custom/ipc
 | 
			
		||||
 | 
			
		||||
exec = echo -e '\uf073'
 | 
			
		||||
click-left = CALCURSE_CALDAV_PASSWORD=$(pass show cal.keegandeppe/kdeppe) calcurse-caldav
 | 
			
		||||
hook-0 = echo -e '\uf073'
 | 
			
		||||
hook-1 = echo -e '%{F#0F0}\uf274'
 | 
			
		||||
hook-2 = echo -e '%{F#F00}\uf273'
 | 
			
		||||
initial = 1
 | 
			
		||||
click-left = calcurse-sync.sh
 | 
			
		||||
 | 
			
		||||
[settings]
 | 
			
		||||
screenchange-reload = true
 | 
			
		||||
 | 
			
		||||
@ -1,2 +1,3 @@
 | 
			
		||||
- link:
 | 
			
		||||
    ~/.config/calcurse: tui/calcurse
 | 
			
		||||
    ~/.local/bin/calcurse-sync.sh: bin/calcurse-sync.sh
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user