Trogdor the Burninator on Nostr: Hoss “Cyber Jester” Delgado kroner :autumnkirby: I wrote a shell script that will ...
Hoss “Cyber Jester” Delgado (nprofile…gu4k) kroner :autumnkirby: (nprofile…usum) I wrote a shell script that will fetch all of the Marseys from rdrama.net's git page and automagically creates a Pleroma emoji pack for them.How to import Marseys
You will need Python installed for this to work, which can be done with apt install python as root or sudo apt-get install python as another user.
Go into adminFE -> emoji -> Settings and look under 'Pack Extensions'. Add .webp to the list and click Submit on the bottom right. (This may not be necessary since my script will auto-create the pack.json file Pleroma looks for)
SSH into your Pleroma server and log in as the pleroma user with sudo -Hu pleroma bash
Create a directory for your marsey emoji and go into it using mkdir -p /opt/pleroma/instance/static/emoji/marseys && cd /opt/pleroma/instance/static/emoji/marseys
Create a file inside the marseys folder called marsey.sh with nano marsey.sh or using another text editor of your choice.
Paste the script at the bottom of this post into the file, exit with CTRL-X and confirm changes with Y then ENTER (if using Nano)
Make the script executable with chmod +X marsey.sh
Run the script using ./marsey.sh
That's it, you should be able to see a fuckton of marseys in your emoji feed after refreshing the page. If not, try restarting pleroma by exiting the pleroma user with exit and doing systemctl restart pleroma.service
#!/bin/bash
git init
git remote add origin https://fsdfsd.net/MarseyWorld/MarseyWorld
git config core.sparseCheckout true
echo "files/assets/images/emojis/*" >> .git/info/sparse-checkout
git pull origin master --depth 1
mv files/assets/images/emojis/* .
rm -rf files
rm -rf .git
find . -type f ! -name '*marsey*' -exec rm {} \;
python3 << END
import os
import json
webp_files = [f for f in os.listdir() if f.endswith('.webp')]
files_dict = {os.path.splitext(f)[0]: f for f in webp_files}
json_data = {
"files": files_dict,
"pack": {},
"files_count": len(webp_files)
}
with open('pack.json', 'w') as json_file:
json.dump(json_data, json_file, indent=4)
print("pack.json has been created successfully.")
END
cd /opt/pleroma
MIX_ENV=prod mix pleroma.emoji get-packs
MIX_ENV=prod mix Pleroma.Emoji reload
You will need Python installed for this to work, which can be done with apt install python as root or sudo apt-get install python as another user.
Go into adminFE -> emoji -> Settings and look under 'Pack Extensions'. Add .webp to the list and click Submit on the bottom right. (This may not be necessary since my script will auto-create the pack.json file Pleroma looks for)
SSH into your Pleroma server and log in as the pleroma user with sudo -Hu pleroma bash
Create a directory for your marsey emoji and go into it using mkdir -p /opt/pleroma/instance/static/emoji/marseys && cd /opt/pleroma/instance/static/emoji/marseys
Create a file inside the marseys folder called marsey.sh with nano marsey.sh or using another text editor of your choice.
Paste the script at the bottom of this post into the file, exit with CTRL-X and confirm changes with Y then ENTER (if using Nano)
Make the script executable with chmod +X marsey.sh
Run the script using ./marsey.sh
That's it, you should be able to see a fuckton of marseys in your emoji feed after refreshing the page. If not, try restarting pleroma by exiting the pleroma user with exit and doing systemctl restart pleroma.service
#!/bin/bash
git init
git remote add origin https://fsdfsd.net/MarseyWorld/MarseyWorld
git config core.sparseCheckout true
echo "files/assets/images/emojis/*" >> .git/info/sparse-checkout
git pull origin master --depth 1
mv files/assets/images/emojis/* .
rm -rf files
rm -rf .git
find . -type f ! -name '*marsey*' -exec rm {} \;
python3 << END
import os
import json
webp_files = [f for f in os.listdir() if f.endswith('.webp')]
files_dict = {os.path.splitext(f)[0]: f for f in webp_files}
json_data = {
"files": files_dict,
"pack": {},
"files_count": len(webp_files)
}
with open('pack.json', 'w') as json_file:
json.dump(json_data, json_file, indent=4)
print("pack.json has been created successfully.")
END
cd /opt/pleroma
MIX_ENV=prod mix pleroma.emoji get-packs
MIX_ENV=prod mix Pleroma.Emoji reload