This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| PID=$(pgrep gnome-session | tail -n1) | |
| export DBUS_SESSION_BUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ | tr '\0' '\n' |cut -d= -f2-) | |
| current_image=$(gsettings get org.gnome.desktop.background picture-uri | xargs echo) | |
| if [ "$1" == "echo" ]; then | |
| echo $current_image |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://learn-powershell.net/2016/01/18/getting-the-icon-from-a-file-using-powershell/ | |
| # (archive link) https://web.archive.org/web/20180609182021/https://learn-powershell.net/2016/01/18/getting-the-icon-from-a-file-using-powershell/ | |
| $exe = 'path\to\.exe' | |
| $png = 'image.png' | |
| $format = [System.Drawing.Imaging.ImageFormat]::Png | |
| [System.Drawing.Icon]::ExtractAssociatedIcon($exe).ToBitmap().Save($png, $format) |
OlderNewer