Windows cursors on linux

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Convert Windows cursors to Linux cursors

avaunit02/cursor-converter

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

readme.md

Windows to Linux cursor converter

dinosaur dinosaur dinosaur dinosaur dinosaur dinosaur dinosaur dinosaur dinosaur dinosaur dinosaur dinosaur

Input files should be in inputs/*.ani and inputs/*.cur Output files will go to outputs/CURSORNAME/CURSORNAME*

Start with a default cursor theme, something like Adwaita

mkdir -p ~/.icons/THEMENAME cp /usr/share/icons/Adwaita/cursors ~/.icons/THEMENAME 

Replace the cursors you want

cp outputs/CURSORNAME/CURSORNAME ~/.icons/THEMENAME/cursors/CURSOR_TO_REPLACE 

You may also have to select the cursor theme. In Gnome, this is done using gnome-tweak-tool , in Appearance/Themes/Cursor select THEMENAME .

About

Convert Windows cursors to Linux cursors

Источник

How to load windows cursors (.cur) in Linux using XLib and Xcursors?

Any obvious error? I can’t really find sources about Xcursor and i’m close to switch to typical OpenGL textures and get over it. NOTE: I’m already disabled Virtualbox integrated mouse, so the mouse is entirely on guest machine and i run it fullscreen.

@Leiaz, thank you for the comment. I assume the cursor you tested with is .xbm (x window bitmap) ? From documentation here i can’t really find out if Xcursor supports .cur or not. Thank you for the effort.

Oh .. that is probably the problem. file says it’s a «X11 cursor». .cur seems to be a Windows format. The Xcursor file format is defined in the man page, I don’t think it’s possible to use another format directly. There is a xcursorgen utility to create a Xcursor from PNG file(s).

@Leiaz, thank you. I had the impression .cur are compatible with Xcursor, but they’re not. Even .xbm or .xpm were not loaded. Your cursors loaded as well 🙂 although i can’t find out what they are or how to create them (i mean, specs) The only thing for sure their header start with Xcur.. . Convert PNGs to xcursor i don’t find it really good since i want to be able to use the same cursor in Windows/Linux and don’t like really to provide hotspots as well; perhaps some internal conversion from .cur to xcurso` might be the way once i find out the xcursor format. I’ll post my results.

Читайте также:  Посмотреть объем файла linux

There was a problem in Oracle Virtualbox not able to show hardware cursors on OpenGL context ; they’ve shown under it and this is known issue (as i learnt) for quite some time now. This gave the impression of cursors-not-loaded. I just switched to VMware and it doesn’t suffering from this.

1 Answer 1

Since i solved my problem i decided it’s a good idea to post my results, in hope of helping someone trying to make his application more cross-platform. My code follows, and explanation follows the code.

  • X11 development headers package (etc. libx11-dev)
  • Xcursor development headers package (etc. libxcursor-dev)
  • A portable header, like this one.
. // to store colors struct COLOR < uint8_t r,g,b,a; COLOR() < this->r = this->g = this->b = this->a = 0; > COLOR(uint8_t r,uint8_t g,uint8_t b) < this->r = r; this->g = g; this->b = b; this->a = 255; > bool operator == (COLOR c) const < return (r == c.r && g == c.g && b == c.b); >>; size_t get_bit(int32_t number,int8_t position) < size_t bitmask = 1 . // load cursor #if defined(_WIN32) // etc. use standard WinApi code, (HCURSOR)LoadImage(..) and such #endif #if defined(__linux__) Display* display = XOpenDisplay(NULL); string filename = "mycursor.cur"; // fread(buf,1,2,fp); // number of images // we're only interested in the first image fread(buf,1,1,fp); // width (0 to 255; 0=means 256 width) int8_t width = (buf[0]==0 ? 256 : buf[0]); fread(buf,1,1,fp); // height (0 to 255; 0=means 256 height) int8_t height = (buf[0]==0 ? 256 : buf[0]); fread(buf,1,1,fp); // number of colors in palette (0 for no palette) fread(buf,1,1,fp); // reserved. should be 0 fread(buf,1,2,fp); // hotspot x int16_t hotspot_x = buf[0] | (buf[1] <<8); fread(buf,1,2,fp); // hotspot y int16_t hotspot_y = buf[0] | (buf[1]<<8); fread(buf,1,4,fp); // image data in bytes fread(buf,1,4,fp); // offset to image data // Now we need to verify if image in .cur is BMP or PNG (Vista+) // We can't just check 'magic' since if it's BMP, the header will be missing (PNG is whole) // So we search for PNG magic; if doesnt exist, we have a BMP! // NOTE: for simplicity we go only for BMP for the moment. // So just check if 'biSize' is 40 (Windows NT & 3.1x or later) // BITMAPINFOHEADER fread(buf,1,4,fp); // biSize int32_t biSize = (buf[0]&0xff) | (buf[1]<<8) | (buf[2]<<16) | (buf[3]<<24); if (biSize!=40) < // error: file does not contain valid BMP data; return; >fread(buf,1,4,fp); // biWidth int32_t biWidth = (buf[0]&0xff) | (buf[1] <<8) | (buf[2]<<16) | (buf[3]<<24); fread(buf,1,4,fp); // biHeight (if positive =>bottom-up, if negative => up-bottom) int32_t biHeight = (buf[0]&0xff) | (buf[1] <<8) | (buf[2]<<16) | (buf[3]<<24); fread(buf,1,2,fp); // biPlanes fread(buf,1,2,fp); // biBitCount int16_t biBitCount = (buf[0]&0xff) | (buf[1]<<8) | (buf[2]<<16) | (buf[3]<<24); if (biBitCount!=24 && biBitCount!=32) < // error: only 24/32 bits supported; return; >fread(buf,1,4,fp); // biCompression int32_t biCompression = (buf[0]&0xff) | (buf[1] <<8) | (buf[2]<<16) | (buf[3]<<24); // we want only uncompressed BMP data if (biCompression!=0 /*BI_RGB*/ ) < // error: file is compressed; only uncompressed BMP is supported; return; >fread(buf,1,4,fp); // biSizeImage fread(buf,1,4,fp); // biXPelsPerMeter fread(buf,1,4,fp); // biYPelsPerMeter fread(buf,1,4,fp); // biClrUsed fread(buf,1,4,fp); // biClrImportant // DECODE IMAGE uint8_t origin = (biHeight>0 ? 0 : 1); // 0=bottom-up, 1=up-bottom // there are cases where BMP sizes are NOT the same with cursor; we use the cursor ones biWidth = width; biHeight = height; COLOR* pixels = new COLOR[biWidth * biHeight]; for(int32_t y=0;y > > // read mask // mask is 1-bit-per-pixel for describing the cursor bitmap's opaque and transparent pixels. // so for 1 pixel we need 1 bit, for etc. 32 pixels width, we need 32*1 bits (or 4 bytes per line) // so for etc. 32 pixels height we need 4*32 = 128 bytes or [mask bytes per line * height] uint16_t mask_bytes_per_line = biWidth / 8; uint16_t mask_bytes = mask_bytes_per_line * biHeight; char* mask = new char[mask_bytes]; fread(mask,1,mask_bytes,fp); fclose(fp); // reverse every [mask_bytes_per_line] bytes; (etc. for 4 bytes per line do: 0,1,2,3 => 3,2,1,0) -> you really need to ask Microsoft for this 8) char rmask[4]; for(uint16_t x=0;x // copy the reversed line for(uint16_t r=0;r > // now extract all bits from mask bytes into new array (equal to width*height) vector bits; for(uint16_t x=0;x > delete[] mask; // reverse vector (?) reverse(bits.begin(),bits.end()); // now the bits contains =1 (transparent) and =0 (opaque) which we use on cursor directly XcursorImage* cimg = XcursorImageCreate(biWidth,biHeight); cimg->xhot = hotspot_x; cimg->yhot = hotspot_y; // create the image for(int32_t y=0;ypixels[offset] = ((bits[offset]==1?0:pix.a) <<24) + (pix.r<<16) + (pix.g<<8) + (pix.b); >> // create cursor from image and release the image Cursor cursor = XcursorImageLoadCursor(display,cimg); XcursorImageDestroy(cimg); . // set the cursor XDefineCursor(display,yourwindow,cursor); XFlush(display); . // free cursor if (cursor!=None)

The above code takes a Windows .cur cursor file and creates an Xcursor for use in X11 window system. Of course, there are lots of limitations to my .cur format handling but one can easily add his own improvements to the above code (like say supporting 8-bit cursors). The above code not only take care of alpha-transparency but also 32-bit alpha-blended cursors

Источник

Windows 7 Cursors download for Linux

This is the Linux app named Windows 7 Cursors whose latest release can be downloaded as Cursor.zip. It can be run online in the free hosting provider OnWorks for workstations.

Download and run online this app named Windows 7 Cursors with OnWorks for free.

Follow these instructions in order to run this app:

— 1. Downloaded this application in your PC.

— 2. Enter in our file manager https://www.onworks.net/myfiles.php?username=XXXXX with the username that you want.

— 3. Upload this application in such filemanager.

— 4. Start the OnWorks Linux online or Windows online emulator or MACOS online emulator from this website.

— 5. From the OnWorks Linux OS you have just started, goto our file manager https://www.onworks.net/myfiles.php?username=XXXXX with the username that you want.

— 6. Download the application, install it and run it.

DESCRIPTION

Windows 7 Cursors for Windows xp

This is an application that can also be fetched from https://sourceforge.net/projects/win7cursors/. It has been hosted in OnWorks in order to be run online in an easiest way from one of our free Operative Systems.

Free Servers & Workstations

Kodi Media Center

Kodi Media Center Ubuntu server Run server

  • More »
    • Pearl OS MAC theme emulator

      Pearl OS MAC theme emulator Special server Run server

    • More »

    Download Windows & Linux apps

    DOSBox DOSBox emulates a full x86 pc with
    sound and DOS. Its main use is to run
    old DOS games on platforms which
    don’t have DOS (Windows 7, 8, 8.1
    and 10 / Linux . Download DOSBox

    Xtreme Download Manager

    Xtreme Download Manager The project has a new home now:
    https://xtremedownloadmanager.com/ For
    developers:
    https://github.com/subhra74/xdm Xtreme
    Download Manager is a powerful tool t. Download Xtreme Download Manager

    Clover EFI bootloader

    Clover EFI bootloader Project has moved to
    https://github.com/CloverHackyColor/CloverBootloader..
    Features:Boot macOS, Windows, and Linux
    in UEFI or legacy mode on Mac or PC with
    UE. Download Clover EFI bootloader

    unitedrpms Join us in Gitter!
    https://gitter.im/unitedrpms-people/Lobby
    Enable the URPMS repository in your
    system —
    https://github.com/UnitedRPMs/unitedrpms.github.io/bl. Download unitedrpms

    Boost C++ Libraries

    Boost C++ Libraries Boost provides free portable
    peer-reviewed C++ libraries. The
    emphasis is on portable libraries which
    work well with the C++ Standard Library.
    See http://www.bo. Download Boost C++ Libraries

    libusb Library to enable user space
    application programs to communicate with
    USB devices. Audience: Developers, End
    Users/Desktop. Programming Language: C.
    Categories. Download libusb

    SWIG SWIG is a software development tool
    that connects programs written in C and
    C++ with a variety of high-level
    programming languages. SWIG is used with
    different. Download SWIG

  • More »
    • The JUMP Pilot Project

      The JUMP Pilot Project OpenJUMP is a community driven fork of
      JUMP the «Java Unified Mapping
      Platform» GIS software. The original
      JUMP was developed by Vivid Solutions,
      relea. Download The JUMP Pilot Project

      XAMPP XAMPP is a very easy to install Apache
      Distribution for Linux, Solaris,
      Windows, and Mac OS X. The package
      includes the Apache web server, MySQL,
      PHP, Perl, a . Download XAMPP

      Win32 Disk Imager

      Win32 Disk Imager This program is designed to write a raw
      disk image to a removable device or
      backup a removable device to a raw image
      file. It is very useful for embedded
      devel. Download Win32 Disk Imager

      7-Zip 7-Zip is a file archiver with a high
      compression ratio. You can use 7-Zip on
      any computer, including a computer in a
      commercial organization. You don’t
      nee. Download 7-Zip

      Tiki Wiki CMS Groupware

      Tiki Wiki CMS Groupware «Software made the wiki way» A
      full-featured, web-based, multilingual
      (40+ languages), tightly integrated,
      all-in-one Wiki+CMS+Groupware, Free
      Source S. Download Tiki Wiki CMS Groupware

      MSYS2 MSYS2 is a collection of tools and
      libraries providing you with an
      easy-to-use environment for building,
      installing and running native Windows
      software. It con. Download MSYS2

      Xtreme Download Manager

      Xtreme Download Manager The project is being actively developed
      on GitHub
      https://github.com/subhra74/xdm Xtreme
      Download Manager is a powerful tool to
      increase download speed up-to 50. Download Xtreme Download Manager

    • More »

    9mount 9mount, 9bind, 9umount — mount/unmount
    9p filesystems . Run 9mount

    9umount 9mount, 9bind, 9umount — mount/unmount
    9p filesystems . Run 9umount

    cpanmp cpanm — get, unpack build and install
    modules from CPAN . Run cpanmp

    cpanpp cpanp — The CPANPLUS launcher . Run cpanpp

    g32pbm g32pbm — convert a Group 3 fax file
    into a portable bitmap . Run g32pbm

    gabedit gabedit — graphical user interface
    (GUI) to computational chemistry
    packages . Run gabedit

  • More »
  • Источник

    Saved searches

    Use saved searches to filter your results more quickly

    You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

    Win10OS cursors for linux desktops

    License

    yeyushengfan258/Win10OS-cursors

    This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

    Name already in use

    A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

    Sign In Required

    Please sign in to use Codespaces.

    Launching GitHub Desktop

    If nothing happens, download GitHub Desktop and try again.

    Launching GitHub Desktop

    If nothing happens, download GitHub Desktop and try again.

    Launching Xcode

    If nothing happens, download Xcode and try again.

    Launching Visual Studio Code

    Your codespace will open once ready.

    There was a problem preparing your codespace, please try again.

    Latest commit

    Git stats

    Files

    Failed to load latest commit information.

    README.md

    This is an x-cursor theme inspired by WinOS and based on capitaine-cursors.

    To install the cursor theme simply copy the compiled theme to your icons directory. For local user installation:

    For system-wide installation for all users:

    Then set the theme with your preferred desktop tools.

    You’ll find everything you need to build and modify this cursor set in the src/ directory. To build the xcursor theme from the SVG source run:

    This will generate the pixmaps and appropriate aliases. The freshly compiled cursor theme will be located in dist/

    Источник

    Оцените статью
    Adblock
    detector