Skip to content

Instantly share code, notes, and snippets.

@tfkhdyt
Created December 25, 2023 00:46
Show Gist options
  • Save tfkhdyt/653deae7e76fd8f38f1fc6c0e89fc5cb to your computer and use it in GitHub Desktop.
Save tfkhdyt/653deae7e76fd8f38f1fc6c0e89fc5cb to your computer and use it in GitHub Desktop.
Yuuko Alert
#!/usr/bin/env bash
yad \
--info --text 'Selamat Pagi !' --title 'Yuuko Alert' \
--image './yuuko_selamat_pagi_greeting-75.png' --button="OK:0" \
--width 200 --height 150 --text-align 'center' --buttons-layout 'center' \
--center
@tfkhdyt
Copy link
Author

tfkhdyt commented Dec 25, 2023

yuuko_selamat_pagi_greeting-75

@adamecki
Copy link

adamecki commented Apr 1, 2024

I've got an idea

#!/bin/bash

if [ $[$(date +%H)] -ge 18 ]; then
	CHARACTER="Mai"
	GREETING="malam"
else
	CHARACTER="Yuuko"
	GREETING="pagi"
fi

yad \
	--info --text "Selamat $GREETING!" --title "$CHARACTER Alert" \
	--image "./${CHARACTER}_selamat_greeting-75.png" --button="OK:0" \
	--width 200 --height 150 --text-align 'center' \
	--buttons-layout 'center' --center

unset GREETING CHARACTER

This one will be time reactive - After 18:00 it shows you "Selamat Malam" (Good evening, which Mai used once to reply Yuuko), and before 18:00 it shows you "Selamat Pagi" (we know that one). I don't know if it will work in 12-hour format (It probably will since man date tells that %H shows hour in 24-hour format regardless of the regional settings). In case-sensitive file-systems (most linux file systems, including ext4), images should start with a capital letter.

Mai_selamat_greeting-75

Sorry for no alpha in this image, but I couldn't find anything better - feel free to replace it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment