mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-30 10:45:13 +08:00
🌴 Sync 2026-03-05 23:51:42
This commit is contained in:
1 parent
97c049ed0a
commit
0acff03804
14253 files changed
+3893239
No files matched your search
@@ -0,0 +1,28 @@
|
||||
config oled
|
||||
option enable '0'
|
||||
option drawline '0'
|
||||
option drawrect '0'
|
||||
option fillrect '0'
|
||||
option drawcircle '0'
|
||||
option drawroundrect '0'
|
||||
option fillroundrect '0'
|
||||
option drawtriangle '0'
|
||||
option filltriangle '0'
|
||||
option displaybitmap '0'
|
||||
option displayinvertnormal '0'
|
||||
option drawbitmapeg '0'
|
||||
option date '1'
|
||||
option netspeed '0'
|
||||
option lanip '1'
|
||||
option ipifname 'br-lan'
|
||||
option cpufreq '1'
|
||||
option cputemp '1'
|
||||
option time '60'
|
||||
option from '0'
|
||||
option to '1440'
|
||||
option autoswitch '0'
|
||||
option rotate '0'
|
||||
option scroll '0'
|
||||
option text 'OPENWRT'
|
||||
option netsource 'eth0'
|
||||
option path '/dev/i2c-0'
|
||||
Executable
+115
@@ -0,0 +1,115 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=88
|
||||
STOP=11
|
||||
USE_PROCD=1
|
||||
PROG=/usr/bin/oled
|
||||
|
||||
get_section() {
|
||||
eval "export -n ${2}=\"$1\""
|
||||
return 1
|
||||
}
|
||||
|
||||
start_service() {
|
||||
local mainsection
|
||||
config_load oled
|
||||
config_foreach get_section oled mainsection
|
||||
local section=$mainsection
|
||||
|
||||
local enabled ; config_get enabled "$section" enable 0
|
||||
if [[ $enabled -eq 0 ]]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command ${PROG}
|
||||
procd_append_param command --needInit
|
||||
|
||||
local param
|
||||
# default /dev/i2c-0
|
||||
config_get param "$section" path
|
||||
[ "$param" != "" ] && procd_append_param command --i2cDevPath="$param"
|
||||
|
||||
# from begin_minitues to end_minitues
|
||||
# default 0 - 1440
|
||||
config_get param "$section" from
|
||||
[ "$param" != "" ] && procd_append_param command --from="$param"
|
||||
config_get param "$section" to
|
||||
[ "$param" != "" ] && procd_append_param command --to="$param"
|
||||
|
||||
config_get param "$section" date
|
||||
[ "$param" == "1" ] && procd_append_param command --displayDate
|
||||
|
||||
config_get param "$section" lanip
|
||||
[ "$param" == "1" ] && procd_append_param command --displayIp
|
||||
config_get param "$section" ipifname
|
||||
if [ "$param" != "" ];then
|
||||
procd_append_param command --ipIfName="$param"
|
||||
else
|
||||
procd_append_param command --ipIfName="br-lan"
|
||||
fi
|
||||
|
||||
config_get param "$section" cputemp
|
||||
[ "$param" == "1" ] && procd_append_param command --displayCpuTemp
|
||||
|
||||
config_get param "$section" cpufreq
|
||||
[ "$param" == "1" ] && procd_append_param command --displayCpuFreq
|
||||
|
||||
config_get param "$section" netspeed
|
||||
[ "$param" == "1" ] && procd_append_param command --displayNetSpeed
|
||||
# default eth0
|
||||
config_get param "$section" netsource
|
||||
[ "$param" != "" ] && procd_append_param command --speedIfName="$param"
|
||||
|
||||
# default 60
|
||||
config_get param "$section" time
|
||||
[ "$param" != "" ] && procd_append_param command --interval="$param"
|
||||
|
||||
config_get param "$section" drawline
|
||||
[ "$param" == "1" ] && procd_append_param command --drawLine
|
||||
|
||||
config_get param "$section" drawrect
|
||||
[ "$param" == "1" ] && procd_append_param command --drawRect
|
||||
|
||||
config_get param "$section" fillrect
|
||||
[ "$param" == "1" ] && procd_append_param command --fillRect
|
||||
|
||||
config_get param "$section" drawcircle
|
||||
[ "$param" == "1" ] && procd_append_param command --drawCircle
|
||||
|
||||
config_get param "$section" drawroundrect
|
||||
[ "$param" == "1" ] && procd_append_param command --drawRoundCircle
|
||||
|
||||
config_get param "$section" fillroundrect
|
||||
[ "$param" == "1" ] && procd_append_param command --fillRoundCircle
|
||||
|
||||
config_get param "$section" drawtriangle
|
||||
[ "$param" == "1" ] && procd_append_param command --drawTriangle
|
||||
|
||||
config_get param "$section" filltriangle
|
||||
[ "$param" == "1" ] && procd_append_param command --fillTriangle
|
||||
|
||||
config_get param "$section" displaybitmap
|
||||
[ "$param" == "1" ] && procd_append_param command --displayBitmap
|
||||
|
||||
config_get param "$section" drawbitmapeg
|
||||
[ "$param" == "1" ] && procd_append_param command --drawBitmapEg
|
||||
|
||||
config_get param "$section" displayinvertnormal
|
||||
[ "$param" == "1" ] && procd_append_param command --displayInvertNormal
|
||||
|
||||
config_get param "$section" rotate
|
||||
[ "$param" == "1" ] && procd_append_param command --rotate
|
||||
|
||||
config_get param "$section" scroll
|
||||
[ "$param" == "1" ] && procd_append_param command --scroll
|
||||
config_get param "$section" text
|
||||
[ "$param" != "" ] && procd_append_param command --scrollText="$param"
|
||||
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "oled"
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
|
||||
uci_write_config() {
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
set oled.@oled[0].showmenu="1"
|
||||
set oled.@oled[0].enable="1"
|
||||
set oled.@oled[0].path="$1"
|
||||
set oled.@oled[0].rotate="$2"
|
||||
set oled.@oled[0].netspeed="$3"
|
||||
set oled.@oled[0].netsource="$4"
|
||||
commit oled
|
||||
EOF
|
||||
}
|
||||
|
||||
. /lib/functions/system.sh
|
||||
|
||||
case "$(board_name)" in
|
||||
hinlink,opc-h69k)
|
||||
uci_write_config '/dev/i2c-5' 1 1 eth0
|
||||
;;
|
||||
esac
|
||||
|
||||
sed -e "/\/etc\/init\.d\/oled/d" -i /etc/crontabs/root && /etc/init.d/cron reload
|
||||
rm -rf /tmp/luci-*
|
||||
exit 0
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"luci-app-oled": {
|
||||
"description": "Grant UCI access for luci-app-oled",
|
||||
"read": {
|
||||
"uci": [ "oled" ]
|
||||
},
|
||||
"write": {
|
||||
"uci": [ "oled" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user