xuefei 发布的文章

git clone https://github.com/macromorgan/chip-debroot.git
cd chip-debroot
git clone https://source.denx.de/u-boot/u-boot.git
cd u-boot
git checkout v2022.01
cd ..
cd u-boot_files/
cp *.patch /home/xuefei/chip-debroot/u-boot/
cp *.config /home/xuefei/chip-debroot/u-boot/
cd ..
cd u-boot
mv chip.config .config
git am --signoff < 0001-board-Add-support-for-Source-Parts-Original-Popcorn.patch
git am --signoff < 0001-i2c-mvtwsi-Add-compatible-string-for-allwinner-sun4i.patch
git am --signoff < 0001-sunxi-Add-option-to-prevent-power-on-when-plug-in.patch
git am --signoff < 0001-sunxi-Add-support-for-slc-emulation-on-mlc-NAND.patch
git am --signoff < 0001-sunxi-nand-Undo-removal-of-DMA-specific-code-that-br.patch
git am --signoff < 0001-w1-Loosen-timings-for-w1-reset.patch

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
看错误,缺少什么装什么
列出一部分
sudo apt install gcc-arm-linux-gnueabihf bison flex swig libarchive-tools python3-dev

编译u-boot
暂时未测试是否可用
2022.4.14测试发现 生成的spl/sunxi-spl.bin 无法刷入
执行 sunxi-fel spl spl/sunxi-spl.bin 会出现usb_bulk_send() ERROR -7: Operation timed out
但macromorgan的可以刷入,这就很奇怪……

https://github.com/homuler/MediaPipeUnityPlugin

You cannot build libraries for Android with the following steps.

1、安装msys2配置系统环境变量Path添加 C:\msys64\usr\bin
执行 pacman -Su
执行 pacman -S git patch unzip
2、安装Python3.9.10 勾选系统环境变量 执行pip install numpy --user
3、安装VS2019,勾选使用C++的桌面开发
4、下载bazel-5.0.0-windows-x86_64.exe 重命名为bazel.exe 并配置系统环境变量
设置Bazel变量
set BAZEL_VS=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
set BAZEL_VC=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC
set BAZEL_VC_FULL_VERSION=14.29.30133
set BAZEL_WINSDK_FULL_VERSION=10.0.19041.0
5、下载nuget 并配置系统环境变量
6、下载opencv-3.4.16-vc14_vc15.exe 运行解压在C盘根目录
7、Android Build Tools<31 Android NDT <22 配置系统环境变量sdk ANDROID_HOME ndk ANDROID_NDK_HOME
步骤7不需要,该工程无法创建Android libraries

最后MediaPipeUnityPlugin工程目录下执行 python build.py build --desktop cpu --opencv=cmake -v
编译
Unity编辑器运行

经测试升级后的pocke-thome 无效
更改 ~/.config/awesome/rc.lua您只需按ctrl+↑或ctrl+ ↓,音量将分别增加或减少 10%
先备份sudo cp .config/awesome/rc.lua .config/awesome/rc.lua.bak
sudo nano .config/awesome/rc.lua

-- Standard awesome library
require("awful")
require("awful.autofocus")
require("awful.rules")
-- Theme handling library
require("beautiful")
-- Notification library
require("naughty")

local USE_DBG = false
dbg = function (msg)
    if USE_DBG then
        naughty.notify({ preset = naughty.config.presets.critical,
                         title = "DBG MSG:",
                         text = msg })
    end
end

dbgclient = function (event_name, c)
    dbg(event_name.." "..tostring(c.pid).." "..tostring(c.window).." "..(c.class or "_c").." "..(c.name or "_n"))
end

-- {{{ Error handling
-- Check if awesome encountered an error during startup and fell back to
-- another config (This code will only ever execute for the fallback config)
if awesome.startup_errors then
    if USE_DBG then
        naughty.notify({ preset = naughty.config.presets.critical,
                         title = "Oops, there were errors during startup!",
                         text = awesome.startup_errors })
    end
end

-- Handle runtime errors after startup
do
    local in_error = false
    awesome.add_signal("debug::error", function (err)
        if USE_DBG then
            -- Make sure we don't go into an endless error loop
            if in_error then return end
            in_error = true

            naughty.notify({ preset = naughty.config.presets.critical,
                             title = "Oops, an error happened!",
                             text = err })
            in_error = false
        end
    end)
end
-- }}}

-- {{{ client API
onboard = {}
home_screen = {}

focus_next_client = function ()
    if awful.client.next(1) == home_screen.client then
        awful.client.focus.byidx( 2 )
    else
        awful.client.focus.byidx( 1 )
    end

    if client.focus then
        client.focus:raise()
    end
end

focus_client_by_window_id = function (window_id)
    for _, c in ipairs(client.get()) do
        if c.window == window_id then
            client.focus = c
            if client.focus then
                client.focus:raise()
            end
        end
    end
end

launch_home_screen = function ()
    if home_screen.client then
        client:kill()
        home_screen = {}
    end
    awful.util.spawn_with_shell("pocket-home")
end

focus_home_screen = function ()
    if home_screen.client then
        client.focus = home_screen.client
        if client.focus then
            client.focus:raise()
        end
    else
        launch_home_screen()
    end
end

hide_mouse_cursor = function ()
    -- hide mouse pointer on root window
    awful.util.spawn_with_shell("xsetroot -cursor $HOME/.config/awesome/blank_ptr.xbm $HOME/.config/awesome/blank_ptr.xbm")
end
-- }}}

-- {{{ Variable definitions
-- Themes define colours, icons, and wallpapers
beautiful.init("/home/chip/.config/awesome/theme.lua")

-- This is used later as the default terminal and editor to run.
local terminal = "x-terminal-emulator"
local editor = os.getenv("EDITOR") or "editor"
local editor_cmd = terminal .. " -e " .. editor

-- Default modkey.
-- Usually, Mod4 is the key with a logo between Control and Alt.
-- If you do not like this or do not have such a key,
-- I suggest you to remap Mod4 to another key using xmodmap or other tools.
-- However, you can use another modifier like Mod1, but it may interact with others.
local modkey = "Mod1"

-- Table of layouts to cover with awful.layout.inc, order matters.
local layouts =
{
    -- awful.layout.suit.floating,
    -- awful.layout.suit.tile,
    -- awful.layout.suit.tile.left,
    -- awful.layout.suit.tile.bottom,
    -- awful.layout.suit.tile.top,
    -- awful.layout.suit.fair,
    -- awful.layout.suit.fair.horizontal,
    -- awful.layout.suit.spiral,
    -- awful.layout.suit.spiral.dwindle,
    -- awful.layout.suit.max,
    awful.layout.suit.max.fullscreen,
    -- awful.layout.suit.magnifier
}
-- }}}

-- {{{ Tags
-- Define a tag table which hold all screen tags.
local tags = {}
for s = 1, screen.count() do
    -- Each screen has its own tag table.
    tags[s] = awful.tag({ 1 }, s, layouts[1])
end
-- }}}

-- {{{ Mouse bindings
root.buttons(awful.util.table.join(
    awful.button({ }, 4, awful.tag.viewnext),
    awful.button({ }, 5, awful.tag.viewprev)
))
-- }}}

volume_up = function ()
    volume_ctl("up", 10);
end
volume_down = function ()
    volume_ctl("down", 10);
end

volume_ctl = function (direction, amount)
    local current_vol = awful.util.pread("amixer sget 'Power Amplifier' | awk -F '[][]' '/dB/ {print substr($2, 1, length($2) - 1)}'")
    current_vol = current_vol:gsub("[\r\n%z]", " ")
    local target_vol = current_vol
    if direction == "up" then
        target_vol = current_vol + amount
        if target_vol > 100 then
            target_vol = 100
        end
    else
        target_vol = current_vol - amount
        if target_vol < 0 then
            target_vol = 0
        end
    end
    awful.util.pread("amixer sset 'Power Amplifier' "..target_vol.."%")
    naughty.notify({
        text="Volume: "..target_vol.."%",
        timeout=1
    })    
end


-- {{{ Key bindings
local globalkeys = awful.util.table.join(
    awful.key({ }                  , "XF86PowerOff", focus_home_screen),
    awful.key({"Control",      }, "Up", volume_up),
    awful.key({"Control",      }, "Down", volume_down),
    awful.key({ modkey,           }, "Tab", focus_next_client),
    awful.key({ "Control",        }, "Tab", focus_next_client),
    awful.key({ modkey,           }, "Return", function () awful.util.spawn("dmenu_run", false) end)

)

local clientkeys = awful.util.table.join(
    awful.key({ "Control"         }, "q", 
        function (c)
            if c ~= home_screen.client then
                c:kill()
            end
        end)
)

-- Compute the maximum number of digit we need, limited to 9
local keynumber = 0
for s = 1, screen.count() do
    keynumber = math.min(9, math.max(#tags[s], keynumber));
end

local clientbuttons = awful.util.table.join(
    awful.button({ }, 1, function (c) client.focus = c; c:raise() end),
    -- left click and mode allows you to move windows
    awful.button({ modkey }, 1, awful.mouse.client.move),
    -- right click when holding mod
    awful.button({ "Control" }, 1, function (c) awful.util.spawn("xdotool click 3", false) end))

-- Set global keys
root.keys(globalkeys)
-- }}}

-- {{{ Rules
awful.rules.rules = {
    -- All clients will match this rule.
    { rule = { },
      properties = { border_width = 0,
                     border_color = beautiful.border_normal,
                     focus = true,
                     keys = clientkeys,
                     buttons = clientbuttons } }
}
-- }}}

-- {{{ Signals
-- Signal function to execute when a new client appears.

client.add_signal("focus", function (c)
  hide_mouse_cursor()
end)

client.add_signal("unfocus", function (c)
  if c == onboard.client then
      awful.util.spawn("xdotool search --name ahoy windowactivate", false)
  end
end)

client.add_signal("manage", function (c, startup)
    -- match homescreen by pid
    if c.name == "pocket-home" then
        home_screen.client = c
    -- match onboarding by class
    elseif c.class == "ahoy" then
        onboard.client = c
        c.ontop = true
    end

    if not startup then
      -- Put windows in a smart way, only if they does not set an initial position.
      if not c.size_hints.user_position and not c.size_hints.program_position then
          awful.placement.no_overlap(c)
          awful.placement.no_offscreen(c)
      end
    end
end)

-- cleanup watched clients
-- FIXME: make sure to ignore if we don't have a client, 
-- apparently it's possible for unmanage to be called before manage
-- when certain applications first open.
client.add_signal("unmanage", function (c)
    -- match homescreen
    if c.name == "pocket-home" then
        home_screen = {}
    -- match onboarding
    elseif c.class == "ahoy" then
        onboard = {}
    end
end)
-- }}}

-- {{{ Startup applications
hide_mouse_cursor()

-- map the keyboard
awful.util.spawn_with_shell("/usr/sbin/pocketchip-load")

-- launch onboarding
awful.util.spawn_with_shell("onboard $HOME/.config/onboard /usr/share/pocketchip-onboard/")

-- launch home screen
launch_home_screen()
-- }}}

原文地址https://blog.omgmog.net/post/pocket-chip-global-volume-control/

The original one was running a relatively heavy shell script (/usr/sbin/battery.sh) outputting many battery-related parameters in order to grep only 2 (voltage and charging status) and put them into two files that were later used by other scripts and even the default home screen program.

sudo apt-get install libx11-dev libxtst-dev git gcc make
git clone https://github.com/aleh/pocketchip-batt.git
cd pocketchip-batt
sudo make install

If you want to undo the changes:
sudo make uninstall

pocket-home appears to be constantly consuming up to 1-4% of CPU, must be polling something fairly hard, would be great to patch it. I've personallly moved to JWM, see https://github.com/aleh config https://github.com/aleh/pocketchip-jwmrc .

IMG_20211128_104916.jpg