mirror of
https://github.com/librephoenix/nixos-config
synced 2025-10-18 17:44:06 +05:30
ranger gcode preview script
This commit is contained in:
parent
1fb21a0543
commit
1a2ac810e3
2 changed files with 17 additions and 0 deletions
|
@ -31,6 +31,20 @@ in {
|
|||
fi
|
||||
fi
|
||||
'')
|
||||
(pkgs.writeScriptBin "gcode-stats" ''
|
||||
#!/bin/sh
|
||||
|
||||
filename="$1";
|
||||
printtime=$(awk -F ":" '/;TIME:/{print $NF; exit}' "$filename");
|
||||
actualprinttime=$(echo "scale=2; $printtime / 3600" | bc);
|
||||
filamentused=$(awk -F ": " '/;Filament used:/{print $NF; exit}' "$filename");
|
||||
bedtemp=$(awk -F " S" '/M140 S/{print $NF; exit}' "$filename");
|
||||
exttemp=$(awk -F " S" '/M104 S/{print $NF; exit}' "$filename");
|
||||
echo "Print Time: $actualprinttime""hr""
|
||||
Filament Used: $filamentused
|
||||
Bed Temp: $bedtemp""C
|
||||
Extruder Temp: $exttemp ""C" > /dev/stdout;
|
||||
'')
|
||||
];
|
||||
|
||||
xdg.mimeApps.associations.added = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue