### Install Dependencies and Build xcur2png Source: https://context7.com/eworm-de/xcur2png/llms.txt Installs necessary development libraries and then builds and installs xcur2png from source using Autotools. Includes commands to confirm the installation and view the manual page. ```bash # Install dependencies (Debian/Ubuntu) sudo apt-get install libpng-dev libxcursor-dev # Install dependencies (Fedora/RHEL) sudo dnf install libpng-devel libXcursor-devel # Build and install ./configure make sudo make install # Confirm installation xcur2png --version # xcur2png version 0.7.1 # View the manual page man xcur2png ``` -------------------------------- ### Round-trip Cursor Theme Workflow Source: https://context7.com/eworm-de/xcur2png/llms.txt A complete workflow for editing an existing X11 cursor theme. It extracts cursors to PNGs, allows for editing, and then rebuilds the theme using xcursorgen. Ensure the work directory is created before starting. ```bash # 1. Extract all cursors from a theme THEME_DIR=/usr/share/icons/MyTheme/cursors WORK_DIR=~/cursor_edit mkdir -p "$WORK_DIR"/{pngs,confs} for cursor in "$THEME_DIR"/*; do name=$(basename "$cursor") xcur2png -q \ -c "$WORK_DIR/confs/${name}.conf" \ -d "$WORK_DIR/pngs/" \ "$cursor" done # 2. Edit PNGs with GIMP or another image editor # gimp "$WORK_DIR/pngs/arrow_000.png" # 3. Rebuild cursors with xcursorgen mkdir -p ~/rebuilt_cursors for conf in "$WORK_DIR/confs"/*.conf; do name=$(basename "$conf" .conf) xcursorgen "$conf" ~/rebuilt_cursors/"$name" done # 4. Install the rebuilt theme mkdir -p ~/.local/share/icons/MyTheme-edited/cursors cp ~/rebuilt_cursors/* ~/.local/share/icons/MyTheme-edited/cursors/ ``` -------------------------------- ### Set Initial Frame Suffix (-i) Source: https://context7.com/eworm-de/xcur2png/llms.txt Overrides the starting index appended to PNG filenames (default: 0). Useful when combining multiple single-size cursors into one multi-size cursor set by extracting each size with a non-overlapping suffix range. ```bash # Extract a 32 px cursor starting at suffix 000 (default) xcur2png -i 0 -d out/ /path/to/cursor32 # Extract a 48 px cursor starting at suffix 100 to avoid filename collision xcur2png -i 100 -d out/ /path/to/cursor48 # out/ now contains: # cursor32_000.png ... cursor32_00N.png # cursor48_100.png ... cursor48_1NN.png # Both conf files can then be merged manually and fed to xcursorgen # to build a multi-size Xcursor ``` -------------------------------- ### Preview Config (Dry-Run -n) Source: https://context7.com/eworm-de/xcur2png/llms.txt Dry-run mode skips writing any PNG files and prints the config data to stdout instead of a file. Progress output is automatically suppressed. This is ideal for previewing what xcur2png would generate before committing to disk. ```bash # Preview the config without touching the filesystem xcur2png -n /usr/share/icons/Adwaita/cursors/move # stdout example: # #size xhot yhot Path to PNG image delay # 32 16 16 move_000.png 1 # 48 24 24 move_001.png 1 # Combine with -c - (equivalent behaviour; -n implies -c -) xcur2png --dry-run /usr/share/icons/Adwaita/cursors/move ``` -------------------------------- ### Basic Conversion: Extract PNGs and Config Source: https://context7.com/eworm-de/xcur2png/llms.txt Converts a single Xcursor file to PNG images and a configuration file. By default, the config file is named '.conf' and PNGs are written to the current directory. ```bash # Extract PNGs and generate config from the system "arrow" cursor xcur2png /usr/share/icons/Adwaita/cursors/arrow # Output produced in the current directory: # arrow.conf ← xcursorgen-compatible config # arrow_000.png ← frame 0 # arrow_001.png ← frame 1 (if animated) # ... # Verify the config content cat arrow.conf # #size xhot yhot Path to PNG image delay # 32 10 5 arrow_000.png 1 # 48 14 7 arrow_001.png 1 ``` -------------------------------- ### Specify Config File Output Path (-c) Source: https://context7.com/eworm-de/xcur2png/llms.txt Controls where the xcursorgen-compatible config file is written. Passing '-' sends the config to stdout. If the path is an existing directory, the file is saved inside it as '.conf'. ```bash # Write config to a specific file path xcur2png -c /tmp/my_cursor.conf /usr/share/icons/Adwaita/cursors/hand1 # Write config to stdout (useful for inspection or piping) xcur2png -c - /usr/share/icons/Adwaita/cursors/hand1 # stdout: # #size xhot yhot Path to PNG image delay # 32 15 3 hand1_000.png 1 # Write config inside an existing directory xcur2png -c /tmp/cursor_output/ /usr/share/icons/Adwaita/cursors/hand1 # Creates: /tmp/cursor_output/hand1.conf ``` -------------------------------- ### Set PNG Output Directory (-d) Source: https://context7.com/eworm-de/xcur2png/llms.txt Redirects all extracted PNG images to a chosen directory. The config file will contain paths relative to itself so that xcursorgen can locate the images correctly. ```bash mkdir -p /tmp/cursor_pngs xcur2png -d /tmp/cursor_pngs /usr/share/icons/Adwaita/cursors/wait # PNGs are saved in /tmp/cursor_pngs/: # /tmp/cursor_pngs/wait_000.png # /tmp/cursor_pngs/wait_001.png # ... # The generated wait.conf references the relative path to /tmp/cursor_pngs/ # Combine -c and -d for fully controlled output locations xcur2png -c /tmp/cursors/wait.conf -d /tmp/cursors/pngs/ \ /usr/share/icons/Adwaita/cursors/wait ``` -------------------------------- ### Suppress Progress Output (-q) Source: https://context7.com/eworm-de/xcur2png/llms.txt Silences all progress output to stderr, which is useful in scripts. By default, xcur2png prints a progress bar and status messages. ```bash # Silent conversion — no stderr output xcur2png -q -d /tmp/out/ /usr/share/icons/Adwaita/cursors/crosshair # Verify exit status echo $? # 0 on success, 1 on runtime error, 2 on syntax error ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.