I put a this as a panel item.
#!/bin/bash
#
#
# Suspend computer(sleep mode)
# The suspension command, will enable the current system state (complete context) to be saved on the RAM.
# The RAM, will be powered off unlike most of the devices in the computer.Once the machine is turned on,
# the state saved on the RAM will be restored automatically. This operation is much faster than
# restoring the state from hibernation since the system state was not saved on the hard disk.
# A suspended system is prone to power outages however since the system state is on the RAM.
#-----------------------------------
systemctl suspend
When I choose an icon, it shows up then disappears.
It occurs with either .png and .jpg icons. And they are the right size.