Removed attic

This commit is contained in:
lanxu 2022-04-03 22:56:18 +03:00
parent a101b152eb
commit 4bff0c15f5
12 changed files with 0 additions and 206 deletions

View File

@ -1,11 +0,0 @@
#!/bin/sh
DEVICES=$(upower -e)
for device in $DEVICES; do
info=$(upower -i $device)
echo "$info"
model=$(echo "$info" | grep -oP 'model: \K\w+[a-zA-Z0-9 ]*$')
battery=$(echo "$info" | grep -oP 'percentage: [0-9 ]*%')
echo "$model: $battery"
done

View File

@ -1,9 +0,0 @@
#!/bin/bash
#UPDATES=$(checkupdates | sed ':a;N;$!ba;s/\n/ /g')
CHECKUPDATES=$(checkupdates)
UPDATES=$(echo "${CHECKUPDATES}" | sed 's/->/-\>/g' | sed ':a;N;$!ba;s/\n/<br>/g')
NUM_UPDATES=$(echo "${CHECKUPDATES}" | wc -l)
#echo "{\"text\": \"${NUM_UPDATES}\", \"tooltip\":\"$UPDATES\"}"
printf "{\"text\": \"%s\", \"tooltip\": \"%s\"}" $(checkupdates | wc -l) "$(checkupdates | tr '\n' '\r')"

View File

@ -1,95 +0,0 @@
#!/bin/php
<?php
$VERSION = 1;
if (isset($argv)) {
//get the file name
$filename = $argv[1];
//see if that file exists
if (file_exists($filename)) {
$xml = simplexml_load_file($filename);
//the xml is now imported
$json = convertXMLToJSONHash($xml);
$new_filename = explode(".", $filename)[0] . ".json";
logMsg("{$json->meta->sprites} textures processed successfully with {$json->meta->app} version {$json->meta->version}");
file_put_contents($new_filename, json_encode($json));
logMsg("Saved to {$new_filename}");
} else {
logMsg("No file exists named: {$filename}");
die();
}
}
else {
logMsg("No input file name provided");
die();
}
die();
function convertXMLToJSONHash($xml){
$json = new stdClass();
//build out the frames obj (contains all the images)
$json->frames = new stdClass();
//build out the meta object (just info about this program)
$json->meta = writeJSONMeta();
//loop through all subtextures
$i = 0;
foreach ($xml->SubTexture as $frame){
//get the attributes for each XML node
$attrs = $frame->attributes();
//make the right object, JSON arr would differ here
$json->frames->{$attrs["name"]} = new stdClass();
//make the frame object
$frame_obj = new stdClass();
$frame_obj->x = intval($attrs["x"]);
$frame_obj->y = intval($attrs["y"]);
$frame_obj->w = intval($attrs["width"]);
$frame_obj->h = intval($attrs["height"]);
//set the frame object
$json->frames->{$attrs["name"]}->frame = $frame_obj;
//make the sprite source object
$sprite_obj = new stdClass();
$sprite_obj->x = 0;
$sprite_obj->y = 0;
$sprite_obj->w = $frame_obj->w;
$sprite_obj->h = $frame_obj->h;
//set the sprite source object
$json->frames->{$attrs["name"]}->spriteSourceSize = $sprite_obj;
//make the source size object
$source_obj = new stdClass();
$source_obj->w = $frame_obj->w;
$source_obj->h = $frame_obj->h;
//set the sprite source object
$json->frames->{$attrs["name"]}->sourceSize = $source_obj;
//add some more stuff that may or may not matter
$json->frames->{$attrs["name"]}->rotated = false;
$json->frames->{$attrs["name"]}->trimmed = false;
//make the pivot object
$pivot_obj = new stdClass();
$pivot_obj->x = 0.5;
$pivot_obj->y = 0.5;
$json->frames->{$attrs["name"]}->rotated = false;
$i++;
}
$json->meta->sprites = $i;
//get root attributes
$attrs = $xml->attributes();
$json->meta->image = (string)$attrs["imagePath"];
return $json;
}
function writeJSONMeta(){
global $VERSION;
$meta = new stdClass();
$meta->app = "TextureAtlasConverter";
$meta->version = $VERSION;
return $meta;
}
function logMsg ($message){
echo "{$message}\n";
}
?>

View File

@ -1,5 +0,0 @@
#!/bin/bash
s=`~/Scripts/dropbox.py puburl "$1"`
zenity --info --text="$s" && echo "$s" | xclip -selection c

View File

@ -1,16 +0,0 @@
#!/usr/bin/python
import os
import re
import lib.helpers as helpers
from subprocess import check_output
hubic_available = helpers.is_exe('/usr/bin/hubic')
if not hubic_available:
print('Not running')
os.exit(1)
return_value = check_output(['hubic', 'status'])
m = re.search(r'State: (.*)', return_value.decode("utf-8"))
print(m.group(1))

View File

@ -1,15 +0,0 @@
#!/bin/sh
# Store password like this:
# ´´secret-tool store --label='KeepassPassword' password keepass``
DATABASE=~/Nextcloud/Avaimet/Passwords.kdbx
PW=$(secret-tool lookup password keepass)
PASSWORDS=$(echo $PW | keepassxc-cli ls -R $DATABASE)
for pass in $PASSWORDS; do
found=$(echo $pass | grep --ignore-case $1)
if [ -n "$found" ]; then
echo $PW | keepassxc-cli show -s -q $DATABASE $found &
fi
done

View File

@ -1,14 +0,0 @@
#!/bin/sh
# First check if lastpass is correctly initialized
if lpass ls 1>/dev/null 2>&1; then
# success
lpass ls | grep --ignore-case $1 | awk '{ if (match($0,/\[id: (.*)?\]/,m)) print m[1] }' | xargs lpass show
# --color=always --format="%ai %au %ap" # unable to use because lpass is buggy with the formatting
else
# failure
echo -n "Enter login name: "
read loginname
lpass login $loginname
fi

View File

@ -1,8 +0,0 @@
#!/bin/python
import sys
if __name__ == "__main__":
ret = '- [ ] ' + sys.argv[1] + "\n"
for ep in range(1, int(sys.argv[2])+1):
ret += " - [ ] Ep. "+str(ep)+"\n"
print(ret)

View File

@ -1,6 +0,0 @@
#!/bin/sh
URI=$1
REALPATH=$(echo "$URI" | sed 's/file\:\/\///g')
export TERMCMD=kitty
notify-send "Opening '$REALPATH'"
kitty -1 ranger '$REALPATH'

View File

@ -1,22 +0,0 @@
#!/bin/bash
if [ $# -eq 0 ]
then
echo "No arguments supplied"
exit -1
fi
WINEDIR=$HOME/Pelit/Wine/$1/
export WINEDEBUG=-all
#export WINEARCH=win32
export WINEPREFIX=$WINEDIR
echo "Run in $WINEDIR"
#if [ $# -eq 1 ]
#then
# wine $2
#fi
shift 1;
exec $@

View File

@ -1,5 +0,0 @@
#!/bin/sh
if [ -z $1 ]; then echo "Search requires search string"; exit 1; fi
grep -Irn "$1" .