Desktop background customisation with Wallwa

Add functionality to your desktop
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Post Reply
blogdron
Level 1
Level 1
Posts: 1
Joined: Thu Jul 04, 2024 5:25 pm

Desktop background customisation with Wallwa

Post by blogdron »

Hello all, I create stupid (but I tried my best, hehe) script on Lua for show applications in desktop mode, video wallpapers for exemple. :D
My code fully trash, but, maybe useful for someone. Works only on cinnamon all other WM in DE no work correctly haha (Xorg X11)

How it looks Image

Video, how it works https://www.youtube.com/watch?v=GELCyrCXHVE

Depends

Code: Select all

apt install lua procps mpv slop x11-utils xdotool rxvt-unicode coreutils
Need build 2 additional utils

xlower

Code: Select all

sudo apt install libx11-dev gcc make pkg-config libxres-dev
git clone https://gitflic.ru/project/blogdron/xlower.git
cd xlower
make
make PREFIX=$HOME/.local install
xwidpid

Code: Select all

sudo apt install libxres-dev
git clone https://gitflic.ru/project/blogdron/xwidpid.git
cd xwidpid
make
make PREFIX=$HOME/.local install
and install wallwa

Code: Select all

git clone https://gitflic.ru/project/blogdron/wallwa.git
cd wallwa
make PREFIX=$HOME/.local install
help (pardon for my awesome english :D)

Code: Select all

Usage: wallwa [URL|FILE|APPLICATION|+APPLICATION]

 This utilite execute GUI application or open mediafile
 or execute CLI application in transparent terminal and
 move any this variants to desktop background like wallpaper.
 Working only under X11 Xorg.

 Wallwa command line options give maximum 2 arguments
 first afrument is string ID started at '@' symbol it
 wallwa item name, after item can be URL,FILE or executable app
 wallwa use mpv for play mediacontent every time in fullscreen mode
 as wallpaper, wallwa use urxvt terminal in transparent mode for CLI.

 If first argument not set, automanicly set and use @default item

Arguments:

    -h  --help         Show this help message
    -i  --info         Show items list
    -l  --load         Load selected item
    -la --load-all     Load all items
    -m  --mouse        Select item position and size uses mouse
    -g  --get          Get selected item as normal window
    -ga --get-all      Get all active items as normal window
    -s  --set          Set selected item to background
    -s  --set-all      Set all active items to background
    -t  --top          In background mode move selected item to up
    -t  --top-all      In background mode restack all items in forward range
    -b  --back         In background mode move selected item to down
    -b  --back-all     In background mode restack all items in backward range
    -k  --kill         Kill selected item
    -ka --kill-all     Kill all active items
    -d  --del          Delete selected item and kill
    -da --del-all      Delete all items and kill
    -p  --pause        Pause selected item
    -pa --pause-all    Pause all active items
    -r  --resume       Resume selected item
    -ra --resume-all   Resume all items from "pause"
    -c  --center       Reposition selected item in screen center
    -ca --center-all   Rereposition all items in screen center
    -f  --full         Resize selected item to fullscreen
    -fa --full-all     Resize all items in fullscreen

    [FILE]             Open mediafile in mpv
    [URL]              Open mediastream in mpv
    application        Execute any* GUI applications in background mode
    +application       Execute any  CLI applications in transparent terminal

    [NUMBER]%                Set opacity for selected item
    [NUMBER]%%               Set opacity for all items
    [NUMBER]x[NUMBER]        Set size for selected item
    [NUMBER]:[NUMBER]        Set pose for selected item
    [NUMBER]x[NUMBER]-center Set item size for selected item
                             and centred item in screen
    *[NUMBER]x[NUMBER]       Relative change size for selected item
    *[NUMBER]:[NUMBER]       Relative change pose for selected item

In relative mode +[NUMBER] add value, -[NUMBER] sub value, [0] no change
For example:
     @itemname *+50:0   #move window to left on 50px
     @itemname *-10x+20 #sub in window width size 10px and add 20px height

More examples:
     This example show case when you have live video wallpaper and htop in
     background mode, you have 2 items @default and @wallpaper and manipulate
     this items resize, move, restack, pause, resume, close and open again, you
     can make many @items and manipulate each individually or all of them at once

     wallwa +htop             #execute htop in transparent terminal as @default item
     wallwa -m                #resize and repose htop window
     wallwa -k                #kill @default item
     wallwa -l                #load again @default item
     wallwa @wallpaper w.mp4  #play video wallpaper in fullscreen mode
     wallwa @default -t       #raise htop above the wallpaper
     wallwa @wallpaper 50%    #set transparent value for wallpaper
     wallwa -pa               #pause @default and @wallpaper
     wallwa -ra               #resume @default and @wallpaper
     wallwa -ka               #close
     wallwa -la               #run again
     wallwa -da               #delete all items and start playing again :D

     If you command for wallwa have multiple words use quotes
     For example you can run another (not urxvt) terminal

     wallwa @myhtop "xterm -fg white -bg black -e htop"

     Wallwa save size and cood position for item you can
     execute another application in current pose and size item

     wallwa @myhtop "xterm -fg white -bg black -e htop"
     wallwa @myhtop "xterm -fg red -bg blue -e htop"
     wallwa @myhtop +htop
     wallwa @myhtop +btop
     wallwa @myhtop "xterm -e top"

     Current wallwa implemented as Lua script and uses
     other awesome applications for its work such as

     * mpv      for playing any media content
     * urxvt    for transparent terminal for CLI applications
     * ps       for get PIDs
     * slop     for use mouse for repose and resize item window
     * xprop    for set and get window parameters
     * wmctrl   for get WID from PID (no used now)
     * xwidpid  for get WID from PID (used now)
     * xlower   for move window to low stack
     * xdotool  for relative change size and pose
     * xwininfo for information about window visible
     * realpath for give absolute path for files and applications

Notice:

     WALLWA EXECUTE PROGRAMS FROM COMMAND LINE, NO RUN DANGER
     COMMANDS, YOU SELF CHECK VALID URL, PLEASE BE CAREFUL WHAT
     COMMANDS YOU PASS TO RUN. This doesn't just apply to any terminal input.

     wallwa can make "Bad Window" erros, becouse Xorg async.
     If you see "Bad Window" error try

        #reload all items
        wallwa -ka ; #kill all
        wallwa -la ; #load all

        #or delete all items
        wallwa -da

    *Some GUI applications work uncorrect in background mode, for example
     chromium,firefox,tilix,gnome-terminal and maybe other applications
     not work correctly in background mode or no change state to background
     This windows have multiple WID`s and now correctly spawn in background
     but uncorrect behavior with options -g, -s, -b, -t manipulations.
     If window have single WID all works fine

     wallwa is prototype util, maybe reimplemented in future.
Well, I have nothing more to say. License for all Zlib. Just decided to share here since it only works with cinnamon. Bye everyone. :D
Post Reply

Return to “Compiz, Conky, Docks & Widgets”