HomeTaskerTasker Smart NavBar #5 Better clipboard manager

Tasker Smart NavBar #5 Better clipboard manager

Creating a better Clipboard Manager

I continue my Smart NavBar actions series with the last standalone action – clipboard manager. So far, used the NavBar to cast stuff to active PC, automate WhatsApp, or control smart devices that are assigned to the room you are in. This time, I will add a clipboard overlay that can store up to 10 previous clipboards which is great for power users.

NavBar Clipboard manager

For this project to work, I used the clipboard manager idea I had with the fingerprint sensor. This post will explain how I used an array to create the AutoTools WebScreen. This article will focus on changes need to make this work in Smart NavBar actions.

NavBar Clipboard action

When a new clipboard is changed the %CLIP variable updates. I can monitor this to call in a new NavBar action. I want the clipboard icon to appear in the NavBar only for a couple of seconds. To achieve this I will create 2 variables that will take the value of %TIMES (%NBtimestart) and %TIMES+15 (%NBtimestop). Then I will set the NavBar icon.

TASKER PROFILE: NB Clipboard changed
Profile: NB Clipboard Changed 
	Event: Variable Set [ Variable:%CLIP Value:* User Variables Only:Off ]
Enter: NB Clip Change 
	A1: Variable Set [ Name:%NBtimestart To:%TIMES  ] 
	A2: Variable Set [ Name:%NBtimestop To:%TIMES+15  ] 
	A3: Wait [ MS:0 Seconds:1 Minutes:0 Hours:0 Days:0 ] 
	A4: Navigation Bar [ Left:back[1.0] 
						 Center:home[1.0] 
						 Right:task(NB Show Clip)[1.0] ]

These variables are used to define the duration of the time context from the 2nd profile. Unless action is taken, appearing web screen with clipboards will disappear after 15 sec.

On entry, I will simply push the clipboard value to my array and trim the array to show only 10 entries (explanation in this post). Since this is a time context, I assigned the exit task that will run once the %TIMES reflects %NBtimestop. On exit, I simply restore the original NavBar and set time variable to some arbitrary values (0,15).

TASKER TASK: CM array numbers
CM array numbers (Do This First) 
	A1: Variable Set [ Name:%CMClipPosition To:1.2.3.4.5.6.7.8.9  ] 
	A2: Variable Split [ Name:%CMClipPosition Splitter:. Delete Base:Off ] 

Please note that to display the clipboard you have to create the array first. This is why you have the CM array numbers task to run first.

Extending lifespan of the clipboard

When one of the clips is used, an AutoApps command is sent. This command contains the clipboard=:=#clippressed value. Sending it to the new profile, I’m setting the element of that number from the array as my new clipboard and I’m extending the %NBtimestop by 15 sec.

TASKER PROFILE: NB Set Clipboard
Profile: NB Set Clipboard
	Event: AutoApps Command [ Configuration:Command Filter: clipboard ]
Enter: NB Set New Clip 
	A1: Set Clipboard [ Text:%CMClipboardArray(%aacomm) Add:Off ] 
	A2: Variable Set [ Name:%NBtimestop To:%TIMES+15 ] 

Additional tasks

There are 2 more tasks that I have to create. One will actually open the Clipboad Manager and display the AutoTools web screen.

TASKER TASK: NB Show Clip
NB Show Clip 
	
	A1: Navigation Bar [ Left:back[1.0] 
						 Center:home[1.0] 
						 Right:task(NB Clip Close)[1.0] ] 
	A2: AutoTools Web Screen [ Configuration:Screen Preset: Card List
		Display Mode: Dialog
		Source: /storage/emulated/0/AutoTools/cardlist/page.html
		Toast Duration: 5000
		Width: 100
		Height: fill
		Gravity: Bottom Right
		Animation: Slide In From Top
		Show Duration: 500
		Hide Duration: 250
		Close On Command: true
		Wait For Command: true
		Title: Clip
		Search Color: #ffffff
		Filter With Search: true
		Command Prefix: search
		Titles: true
		Subtitles: true
		Subtext Left: true
		Subtext Right: true
		Whole Words: true
		Drawer Width: 80%
		Card Titles: %CMClipPosition()
		Card Subtext Left: %CMClipAbrev()
		Card Commands: %CMClipPosition()
		Commands Prefix: clipboard
		Round Card Icons: true
		Background Color: #BDBDBD
		Accent Color: #F9A825
		Max Card Widths: 90%
		Max Image Heights: 75
		Title Text Size: 5
		Subtitle Text Size: 22
		Card Padding: 0
		Card Alignment: Center
		Item Separator: , Timeout (Seconds):30 ] 

The only addition to the mix is swapping the NavBar icon for the one I can use to close the clipboard. If I change my mind, I want to have an option to close the clipboard manager completely.

TASKER TASK: NB Clip Close
NB Clip Close
	A1: Navigation Bar [ Left:back[1.0] 
						 Center:home[1.0] 
						 Right:task(NB Show Clip)[1.0] ] 
	A2: AutoTools Web Screen [ Configuration:Screen Preset: Swipe
		Display Mode: Close
		Source: /storage/emulated/0/AutoTools/swipe/page.html
		Toast Duration: 5000
		Background Color: #00CE93D8
		Width: 10
		Height: 400
		Gravity: Bottom Right
		Animation: Slide In From Bottom
		Show Duration: 500
		Hide Duration: 250
		Drag: Not Draggable
		Hide Dialog Shadow: true
		Inject In Header: var a=1;
		Commands Prefix: swipe
		Swipe Left: left
		Swipe Right: right
		Swipe Up: up
		Swipe Down: down
		Border Color: #AB47BC
		Border Witdh: 3
		Border Side: Right Timeout (Seconds):30 ] 
	A3: Flash [ Text:Close Long:Off ] 
	A4: Perform Task [ Name:NB Reset Clip Priority:%priority Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:Off ] 

The other task will run when the close clipboard is triggered and it will close the web screen and restore the original NavBar.

Smart NavBar integration

This is a stand-alone version of the Smart NavBar actions. Once I created the standalone versions for each NavBar Task I will show you how to integrate it together. You can read the tutorial about this now!

Conclusion

This very unintrusive NavBar Clipboard Manager can help you manage multiple clipboards without taking your precious screen estate when not needed. You can change the number of stored clipboards or the way the cards look. If you have any questions about the project, feel free to leave me a comment in this Reddit thread.

Project Download

Download project files here. Bear in mind that Patreon supporters have early access to project files and videos.

PayPal

Nothing says "Thank you" better than keeping my coffee jar topped up!

Patreon

Support me on Patreon and get an early access to tutorial files and videos.

image/svg+xml

Bitcoin (BTC)

Use this QR to keep me caffeinated with BTC: 1FwFqqh71mUTENcRe9q4s9AWFgoc8BA9ZU

New to Tasker?

Tasker Quick Start – Getting started with Tasker

0
From newb to not so newbie in 10 min

Best Tasker Projects

How to use Raspberry PI as WOL (wake on lan) server

0
While you could wake up your PC from a mobile directly, having a dedicated server capable of doing so is the best solution. The reason is simple. You can hook up as many devices as you wish with a single endpoint. This is why Raspberry Pi is perfect for this.

How to wake on LAN computers and put it to sleep with Power Menu,...

0
How to Wake on LAN properly via Android, Alexa, Google Assistant and Web

7 awesome Bluetooth keyboard shortcuts for Android

0
7 unique Android shortcuts that you can add to any Bluetooth keyboard.

Smart overnight charging with Tasker

0
Still keeping your phone plugged in overnight? Try smarter overnight charging with this profile

One thing that Join app can’t do and how to fix it with Tasker

0
It's not possible to share the clipboard automatically between join accounts registered to 2 different emails. But you can fix this with tasker.

Essential Guides

Tasker: Seconds into DD:HH:MM:SS (dynamic)

0
It's time to.... ok it's a pun, but I will show you how to master time and convert seconds to DD:HH:MM:SS dynamically

4 ways to organise Tasker projects

0
Keep your Tasker tidy!

A better way to store Tasker credentials

0
The more clever way of managing credentials

Annoyed with dozens of AutoApps populating your app drawer? Here is a fix!

0
Clear your app drawer from the clutter in seconds

Putting AutoTools pie chart to a good use – SSID logger

0
Who wants a piece of the pie (chart)?