Skip to content

Commit

Permalink
dkpg packages
Browse files Browse the repository at this point in the history
  • Loading branch information
walksanator committed May 23, 2022
1 parent 43a11d7 commit e0eec97
Show file tree
Hide file tree
Showing 16 changed files with 825 additions and 26 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.deb
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
git clone https://github.com/walksanatora/qoi-thumbnailer-nemo
```
2. `cd qoi-thumbnailer-nemo`
3. run install script as root
3. build the apt packages
```sh
sudo ./install.sh
./build.sh
```
4. done just open up Nautilus/Nemo/Caja to a folder with a .qoi file
5. if thumbnails do not show up try
4. install the `qoi-thumbnailer` and `qoiconv` packages

if thumbnails do not show up try
```sh
rm -rfv ~/.cache/thumbnails
<file explorer> -q # fully quits the file explorer so it can search for new thumbnailers
Expand Down
3 changes: 3 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
dpkg-deb --build qoi-thumbnailer
dpkg-deb --build qoiconv
35 changes: 17 additions & 18 deletions install.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ else
exit 1
fi

if command -v comvert >/dev/null;then
if command -v convert >/dev/null;then
if convert -h | head -n1 | grep "ImageMagick";then
echo "'convert' from ImageMagick is installed"
else
Expand All @@ -46,48 +46,47 @@ else
echo "qoiconv not found, checking git and gcc"
missing_gcc="y"
missing_git="y"
missing_stb="y"
if command -v git >/dev/null;then
missing_git="n"
fi
if command -v gcc >/dev/null;then
missing_gcc="n"
fi
if [[ "$missing_git" = "n" && "$missing_gcc" = "n" ]];then
echo "found git and gcc. installing qoiconv"
if [[ -d "/usr/include/stb" ]];then
missing_stb="n"
fi
if [[ "$missing_git" = "n" && "$missing_gcc" = "n" && "$missing_stb" = "n" ]];then
echo "found git, gcc and libstb. installing qoiconv"
mkdir -p /usr/local/opt
cd /usr/local/opt || exit 3
git clone "https://github.com/phoboslab/qoi"
cd qoi || exit 3
if [[ -d "/usr/include/stb" ]];then
gcc qoiconv.c -std=c99 -O3 -o qoiconv -I/usr/include/stb
ln -fs "$PWD/qoiconv" "/usr/local/bin/"
echo "qoiconv installed"
else
echo "cannot find 'stb' folder please install"
echo "sudo apt install libstb-dev"
exit 2
fi
gcc qoiconv.c -std=c99 -O3 -o qoiconv -I/usr/include/stb
ln -fs "$PWD/qoiconv" "/usr/local/bin/"
echo "qoiconv installed"
else
echo "missing either git or gcc or both."
echo "missing either git, gcc, and/or libstb."
echo "missing git: $missing_git"
echo "missing gcc: $missing_gcc"
echo "missing libstb: $missing_stb"
exit 1
fi
fi

cd "$hme" || exit 3

echo "quickly chmod +x ing the thumbnailer script just in case"
chmod +x ./qoi-thumbnail
chmod +x ./qoi-thumbnail
echo "copying thumbnailer script to /usr/local/bin"
cp ./qoi-thumbnail "/usr/local/bin"
cp ./qoi-thumbnailer/qoi-thumbnailer/local/bin/qoi-thumbnail "/usr/local/bin"
echo "copying .thumbnailer file to /usr/share/thumbnailers"
cp ./qoi.thumbnailer "/usr/share/thumbnailers"
cp ./qoi-thumbnailer/qoi-thumbnailer/share/thumbnailers/qoi.thumbnailer "/usr/share/thumbnailers"
echo "copying x-qoi.xml to /usr/local/share/mime/packages"
cp x-qoi.xml "/usr/local/share/mime/packages"
cp ./qoi-thumbnailer/qoi-thumbnailer/share/mime/packages/x-qoi.xml "/usr/local/share/mime/packages"
echo "updateing mime database"
update-mime-database "/usr/local/share/mime"
echo "installing magic number (so 'qoi' images can be picked up via the 'file' command)"
echo "0 string qoif image/x-qoi" >> /etc/magic
echo "!:mime image/x-qoi" >> /etc/magic
echo "Done"
echo "Done"
1 change: 0 additions & 1 deletion qoi
Submodule qoi deleted from 805953
6 changes: 6 additions & 0 deletions qoi-thumbnailer/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Package: qoi-thumbnailer
Version: 1.0
Maintainer: Walksanator
Architecture: all
Depends: imagemagick, qoiconv
Description: support for thumbnailers in nemo and similar desktop file explorers
6 changes: 6 additions & 0 deletions qoi-thumbnailer/DEBIAN/postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
update-mime-database "/usr/local/share/mime"
#register mime with `file` command
echo "0 string qoif image/x-qoi" >> /etc/magic
echo "!:mime image/x-qoi" >> /etc/magic

File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions qoiconv/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Package: qoiconv
Version: 1.0
Maintainer: walksanator
Architecture: all
Depends: gcc, wget, libstb-dev
Description: Qoiconv package for handling converting .qoi to other image formats
4 changes: 4 additions & 0 deletions qoiconv/DEBIAN/postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
cd /usr/local/opt/qoi|| exit 1
gcc qoiconv.c -std=c99 -O3 -o qoiconv -I/usr/include/stb
ln -s $PWD/qoiconv /usr/local/bin/qoiconv
2 changes: 2 additions & 0 deletions qoiconv/DEBIAN/postrm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
rm /usr/local/bin/qoiconv || echo
Loading

0 comments on commit e0eec97

Please sign in to comment.