Score:0

Idle time detection for Dashboard screensaver (changing to another website)

bv flag

I would like to create a dashboard which changes the web page after a certain idle time and after activity jumps back to the original page.

Unfortunately I have absolutely no idea of programming and have already spent for a few lines many hours :D.I would like to integrate a code that i found but I have absolutely no idea how to do it

my code:

  /etc/xdg/openbox/autostart *                                                                                                         

# If you want to use XFCE config tools...
#
#xfce-mcs-manager &
xset -dpms            # turn off display power management system
xset s noblank        # turn off screen blanking
xset s off            # turn off screen saver


# Remove exit errors from the config files that could trigger a warning

sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' ~/.config/chromium/'Local State'

sed -i 's/"exited_cleanly":false/"exited_cleanly":true/; s/"exit_type":"[^"]\+"/"exit_type":"Normal"/' ~/.config/chromium/Default/Preferences

# Run Chromium in kiosk mode
chromium-browser  --noerrdialogs --disable-infobars --enable-features=OverlayScrollbar --check-for-update-interval=31536000 --kiosk http://192.168.178.88:8123 https://dakboard.com/app/xxxxxxxx &



***while true; do
   xdotool keydown ctrl+Next; xdotool keyup ctrl+Next;
   sleep 10
done
* for testing***

the idle code i found:

idleloop() {
    touch /tmp/.{,last_}input
    cmd='stat --printf="%s"'
    idletime=120
    a=2
    t=0
    while true
    do
        timeout 1 xinput test-xi2 --root > /tmp/.input
        
        if [[ `eval $cmd /tmp/.input` == `eval $cmd /tmp/.last_input` ]]
        then
            let t++ # increases $t by 1
        else
            t=0     # resets $t
        fi

        mv /tmp/.{,last_}input -f

        if [ $t -ge $idletime ] && [[ $a == "2" ]]
        then
            echo "user has gone idle"
            a=1
        fi
        if [ $t -lt $idletime ] && [[ $a == "1" ]]
        then
            echo "user has come back from idle"
            a=2
        fi
    done
}

idleloop

Br,

Michael

Pilot6 avatar
cn flag
How is it related to Ubuntu?
Casemod avatar
bv flag
The operating system is ubuntu and the repositories also need to be installed using Ubuntu commands or?
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.