Comments (4)
I don't have the time to set this up with a PR for the wallpaper plugin but here is a bash script that will generate a 1x1 BMP file for a specific hex code:
hexCode="b3a33e"
# Below are the bytes representing a 1x1 BMP. We substitute in the HEX color values from the above hex code into the appropriate byte positions
# Note that BMP uses BGR (Blue Green Red) instead of RGB (Red Green Blue)
bmpBytes="\x42\x4D\x44\x00\x00\x00\x00\x00\x00\x00\x3E\x00\x00\x00\x28\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x01\x00\x00\x00\x00\x00\x06\x00\x00\x00\x12\x0B\x00\x00\x12\x0B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x${hexCode:4:2}\x${hexCode:2:2}\x${hexCode:0:2}\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
targetTempFile=$(mktemp)
echo -n -e "$bmpBytes" > "$targetTempFile"
echo "$targetTempFile"
Tested setting my wallpaper to this BMP and it fills the whole screen as long as the wallpaper is set to a setting that attempts to fill the screen.
from m-cli.
Great idea @jdf221! I found out that bmp file can be even smaller.
I have improved that script a bit and now it works perfectly. Thanks.
#!/bin/sh
# hex2bmp
while read -r hex; do
out=$(mktemp)
printf "424d1e000000000000001a0000000c0000000100010001001800%s00" \
"${hex:4:2}${hex:2:2}${hex:0:2}" | xxd -p -r > "$out"
echo "$out"
done
m wallpaper $(echo 2B3339 | hex2bmp)
from m-cli.
That's a great solution, if I get time I'll try putting a PR together for it
from m-cli.
An interesting request. I'm terrible with Applescript, and I suspect that's the way to do it. If anyone else knows of a way, I'm happy to help, otherwise this might take a while...
from m-cli.
Related Issues (20)
- m bluetooth command doesn't work HOT 2
- iTunes commands not working on macOS 10.15.6 HOT 4
- Firewall State 2 HOT 6
- Automated test suite
- Airdrop status outputs an error first use HOT 1
- `m trash status` return incorrect content info
- wallpaper command only sets wallpaper for current desktop HOT 2
- localhost operator uses wrong sed parameter HOT 2
- Fix hard coded default wi-fi interface HOT 2
- We can add more features to DNS plugin HOT 1
- Bash 5.1 errors, unary operator expected HOT 2
- Usage information not following POSIX standard HOT 2
- Headless HOT 1
- Combined itunes play/pause
- AirDrop off disables airdrop even after uninstall
- Roadmap HOT 1
- m bluetooth is not working in apple m1 pro
- m bluetooth is not working in apple m1 pro HOT 2
- Project dead? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from m-cli.