...hello there :)...

search this blog

..traces left on one February 15, 2019 12:49

Kustom code snippets.

post on:
Mood:

Feb, 2019 - My current KLCK "kustom" lockscreen :)

update: March 16, 2019

If/else construction.

(global value c1 during the day, otherwise c4)
$if(ai(isday)=1,gv(c1),gv(c4))$


Convert anything to uppercase.

$tc(up,df(MMM))$


Wi-Fi status + uptime + current speed.

It will display:

connected
Uptime: 1 day
5.84kb/s

Here is the code with sample text formatting:

[s=.74][c=#FFFFFFFF]$nc(wifi)$[/c][/s]
Uptime: [c=#FFFFFFFF][b]$tf(df(S) - df(S, si(boot)))$
$ts(trx)$[/b][/c]


"On-Line/Off-Line". (based on Wi-Fi status)

$if
(nc(wifi)=connected,
"On-Line",
"Off-Line")
$


Color dependent on battery level. (three levels)

$if(bi(level) > 60, #00C000, bi(level) > 20, #00A0FF, bi(level) <=20, #FF0000)$


Message dependent on battery level. (three levels)

Battery $if(bi(level) = 100, "is full", bi(level) <= 20, "time to charge", "is " + bi(level) + "%" )$


Message dependent on time of the day. (four time spans)

$if(df(hh)>5 & df(hh)<11, "Nice morning!",if(df(hh)>=11 & df(hh)<=18, "Nice day!",if(df(hh)>18 & df(hh)<23, "Nice evening!", "Nice night!")))$


Random image with a sample directory. (every 90 minutes)

$tu(rndimg, 90, "/storage/emulated/0/zedge/lockscreen")$


An example ("muted") color based on a picture defined in a global.

$bp(muted, gv(GlobalName))$


Message on reaching particular uptime.

  1. Place the text you want in an Overlap Group.
  2. Next put this formula in the Visibility settings in the Layer tab of the Group.

$if(tf(df(S) - df(S, si(boot)), D)>=3, VISIBLE, NEVER)$


Message displayed if no notifications.

Follow the same two-step instruction as before.

$if(ni(count)>0, NEVER, VISIBLE)$


A street name instead of a whole address.

$tc(reg, li(addr), ",.*","")$


Time to sunrise.

$tf(ai(nsunrise))$


Resources:

No comments:

Post a Comment