# penger-xpet **Repository Path**: EEPPEE_admin/penger-xpet ## Basic Information - **Project Name**: penger-xpet - **Description**: xpet penger version, copy penger from tsoding - **Primary Language**: Unknown - **License**: GPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-06-23 - **Last Updated**: 2026-07-05 ## Categories & Tags **Categories**: Uncategorized **Tags**: xpm, X11 ## README # X11 桌面企鹅宠物程序 ## 项目需求 编写一款 X11 桌面宠物程序: 1. 功能:企鹅在桌面随机游走,纯娱乐趣味程序 2. 提供四种代码版本: - 读取本地资源:加载 `assets/left_64.xpm` 图片运行版 - XPM内嵌代码版:直接将XPM像素代码写入C源码,无需外部资源文件 - 缩放倍率版:支持自定义画面缩放系数 - 命令行传参版:CLI 传入自定义XPM文件作为宠物素材 3. 编译指令:提供Linux静态编译命令 ## 编译命令 ```bash gcc -Wall -Wextra main.c \ -pthread \ -L/usr/lib/x86_64-linux-gnu/ \ -Wl,-Bstatic \ -l:libXpm.a \ -l:libX11.a \ -l:libXext.a \ -l:libX11-xcb.a \ -l:libxcb-shm.a \ -l:libxcb.a \ -l:libXau.a \ -l:libXdmcp.a \ -Wl,-Bdynamic \ -lm -ldl -lpthread \ -Wl,--as-needed \ -Wl,-z,relro,-z,now \ -o pet_static ``` ## 开发备注 随心二次开发即可 ### 拓展开发须知 XPM 本质为文本格式文件,内置色彩配置字段,可直接修改字段颜色,自定义宠物配色 ## 素材参考仓库(取用XPM图片素材) 1. tsoding sowon 企鹅素材:https://github.com/tsoding/sowon 2. xfiles 应用图标XPM素材:https://github.com/phillbush/xfiles 3. xpet 桌面宠物XPM动画素材:https://github.com/uint23/xpet 4. timidity 播放器XPM图标素材:https://github.com/geofft/timidity --- # a x11 pet program - a penguin running randomly on the screen, just for fun - provide read assets/left_64.xpm version and embed xpm into c code version - provide scale factor version - provide take xpm as args container cli program version # build ```bash gcc -Wall -Wextra main.c \ -pthread \ -L/usr/lib/x86_64-linux-gnu/ \ -Wl,-Bstatic \ -l:libXpm.a \ -l:libX11.a \ -l:libXext.a \ -l:libX11-xcb.a \ -l:libxcb-shm.a \ -l:libxcb.a \ -l:libXau.a \ -l:libXdmcp.a \ -Wl,-Bdynamic \ -lm -ldl -lpthread \ -Wl,--as-needed \ -Wl,-z,relro,-z,now \ -o pet_static ``` # happy hacking this program ## notes for more - since xpm file is a text file, it has color field, so you can hack into color field to display custom color # ref links ### mainly copy xpm files from - tsoding sowon penguin resource: https://github.com/tsoding/sowon - xfiles xpm files for file-app.xpm: https://github.com/phillbush/xfiles - xpet xpm file resource: https://github.com/uint23/xpet - timidity timi xpm resource: https://github.com/geofft/timidity