i can get terminal idle time by
w command as follows
$ w 14:37:58 up 2 days, 20:16, 2 users, load average: 0.12, 0.16, 0.14 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT charan tty7 Fri18 2days 3:53 0.33s gnome-session --session=ubuntu charan pts/0 :0 14:33 6.00s 0.19s 0.00s w
tty gives me current tty as bellow
$ tty /dev/pts/0
And i want to run a shell script in same tty when idle time is more than some
How can i do that ?