Added 2 scripts; 1 notes
This commit is contained in:
parent
72947360ea
commit
598c60045a
|
@ -0,0 +1,38 @@
|
|||
#fix gamepad/joystick
|
||||
#ifyoo - /dev/input/by-id/usb-SHANWAN_Controller-event-joystick
|
||||
|
||||
#install needed python libs
|
||||
# sudo apt install python3-usb
|
||||
# OR
|
||||
# python -m pip install pyusb==1.2.1
|
||||
|
||||
#get fix script
|
||||
#https://gist.github.com/dnmodder/de2df973323b7c6acf45f40dc66e8db3
|
||||
wget "https://gist.githubusercontent.com/dnmodder/de2df973323b7c6acf45f40dc66e8db3/raw/693b848098dfc5f0fd03bdcdd9162fde3f2fb482/fixcontroller.py"
|
||||
|
||||
chmod +x fixcontroller.py
|
||||
|
||||
#you will need to run this every time you plug the controller in
|
||||
sudo ./fixcontroller.py
|
||||
|
||||
#test the controller
|
||||
sudo cat /dev/input/js0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
###############################3
|
||||
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import usb.core
|
||||
|
||||
dev = usb.core.find(idVendor=0x045e, idProduct=0x028e)
|
||||
|
||||
if dev is None:
|
||||
raise ValueError('Device not found')
|
||||
else:
|
||||
dev.ctrl_transfer(0xc1, 0x01, 0x0100, 0x00, 0x14)
|
||||
|
||||
##############################3
|
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import usb.core
|
||||
|
||||
dev = usb.core.find(idVendor=0x045e, idProduct=0x028e)
|
||||
|
||||
if dev is None:
|
||||
raise ValueError('Device not found')
|
||||
else:
|
||||
dev.ctrl_transfer(0xc1, 0x01, 0x0100, 0x00, 0x14)
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
# !/bin/bash
|
||||
# #####################################################################
|
||||
# Copyright (C) 2018 Kris Occhipinti
|
||||
# https://filmsbykris.com
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# #####################################################################
|
||||
|
||||
domain="https://www.1001freefonts.com"
|
||||
pagenum="100"
|
||||
|
||||
for i in `seq 1 $pagenum`;
|
||||
do
|
||||
wget -q "$domain/new-fonts-$i.php" -O-|\
|
||||
grep DOWNLOAD|\
|
||||
cut -d\' -f2|\
|
||||
sort -u|while read u;
|
||||
do
|
||||
wget -c "$domain$u"
|
||||
done
|
||||
done
|
||||
|
||||
#unzip files
|
||||
for z in *.zip;
|
||||
do
|
||||
unzip -o "$z";
|
||||
done
|
||||
|
||||
#move fonts to fonts folder
|
||||
mkdir -p $HOME/.local/share/fonts
|
||||
find -iname "*.ttf" -o -iname "*.otf"|while read f
|
||||
do
|
||||
mv "$f" $HOME/.local/share/fonts
|
||||
done
|
||||
|
||||
#update fonts to system
|
||||
fc-cache -f -v
|
|
@ -0,0 +1,66 @@
|
|||
# !/bin/bash
|
||||
# #####################################################################
|
||||
# Copyright (C) 2019 Kris Occhipinti
|
||||
# https://filmsbykris.com
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, o
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# #####################################################################
|
||||
|
||||
output="$HOME/.files/emojis.lst"
|
||||
|
||||
function main() {
|
||||
if [ "$1" = "update" ]; then
|
||||
getlist
|
||||
elif [ "$1" = "menu" ]; then
|
||||
menu
|
||||
else
|
||||
xfce4-terminal -e 'bash -c "/usr/local/bin/emojis menu"'
|
||||
fi
|
||||
}
|
||||
|
||||
function menu(){
|
||||
# Give fzf list of all unicode characters to copy.
|
||||
# Shows the selected character in dunst if running.
|
||||
|
||||
fzf="$HOME/.fzf/bin/fzf"
|
||||
#e="$(grep -v "#" "$output" | dmenu -i -l 20 -fn Monospace-18 | awk '{print $1}' | tr -d '\n'|fzf)"
|
||||
#e="$(grep -v "#" "$output" |awk '{for (i=2; i<NF; i++) printf $i " "; print $NF}' |dmenu -i -l 20 -fn Monospace-18)"
|
||||
e="$(grep -v "#" "$output" |$fzf|awk '{print $1}')"
|
||||
#e="$(grep " $e\$" "$output" | awk '{print $1}' | tr -d '\n')"
|
||||
echo "$e" | xclip -selection clipboard
|
||||
echo "$e" | xclip
|
||||
|
||||
pgrep -x dunst >/dev/null && notify-send "$e copied to clipboard."
|
||||
}
|
||||
|
||||
function getlist() {
|
||||
mkdir -p "$HOME/.files"
|
||||
wget -qO- "https://en.wikipedia.org/wiki/Emoji"|\
|
||||
tr "\n" " "|\
|
||||
sed 's/<td/\n/g'|\
|
||||
grep "U+"|\
|
||||
grep "^ title"|while read l
|
||||
do
|
||||
t="$(echo "$l"|cut -d\: -f2|cut -d\" -f1)"
|
||||
e="$(echo "$l"|sed 's/title="/|/g'|cut -d\| -f3|cut -d\" -f1)"
|
||||
if [ "$e" != " " ]
|
||||
then
|
||||
echo "$e$t"
|
||||
fi
|
||||
done|tee "$output"
|
||||
|
||||
echo "emoji list has been saved to $output"
|
||||
}
|
||||
|
||||
main $*
|
Loading…
Reference in New Issue