Skip to content
/ swef Public

The Should Work Everywhere Fetch... or at least it should

License

Notifications You must be signed in to change notification settings

rice7th/swef

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

swef

The Should Work Everywhere Fetch.

Maintenance GitHub code size in bytes GitHub release (latest by date)

image

Example of the fetch on ubuntu

Written mainly in Lua, SWEF is a generic system fetch that works (nearly) everywhere, even on windows, without emulating shells or using some weird compatibility layes. The only dependencies are Lua (5.1+) and xprop, but xprop is required only on X11 systems, meaning that you dont need it for android, MacOs, windows and wayland systems. Also Xprop is usually preinstalled on X11 systems, but double-checking never hurts :)

Installation

Clone the repo:

git clone https://github.com/rice7th/swef

Then build install it in these ways, depending on the system:

Linux

use the makefile:

sudo make install

MacOS

again use the makefile:

sudo make install

Android

Make sure to use Termux.

pkg install lua # or luajit
git clone https://github.com/rice7th/swef/
cd swef
chmod +x src/swef
cp src/swef /data/data/com.termux/files/usr/bin

Windows

run the file every time you want to use it i think

lua53 C:\path\to\swef

or use a batch file idk

lua53 C:\path\to\swef

and then run the batch file:

C:\path\to\batch_file.bat

also note that you can move the batchfile into C:\Program Files\swef\ and it will run as a program

replace lua53 with your current lua version: e.g. if you have lua 5.4 installed, replace lua53 with lua54

9Front/Plan9

I could not believe i've managed to do this...

first, grab git. If you are on 9Front it is preinstalled, otherwise you should download git9 by Oridb. Next, install Lu9, Lua with full plan9/9front support. You can read the instructions here Finally, clone this repo and run swef:

git/clone https://github.com/rice7th/swef/
cd swef/src
lu9 swef -n

Escape codes are not supported on plan9/9front, so make sure to run swef with the -n or the --no-color flag to avoid fancy issues.

Effectiveness

The fetch (as the name suggests) SHOULD work everywhere; These are the places where i tested it:

Kubuntu

  • Kubuntu 20.04 (Kde, X11, AwesomeWM)

Fedora

  • Fedora 35 (Gnome, Wayland, Mutter)

Alpine Linux

  • Alpine Linux 3.15 (XFCE, X11, XFWM4)

Void Linux

  • Void Linux (none, x11, AwesomeWM)

Arch Linux

  • Arch Linux (Gnome, x11, AwesomeWM)

Windows 10

  • Windows 10 Pro (Metro, ??, Explorer)

Andorid 9

  • Android 9 (Material, ??, are there WMs for android?)

MacOS BigSur

  • MacOS Big Sur (Aero, Quartz, Quartz Compositor)

Haiku

  • Haiku (??, ??, ??)

  • FreeBSD (none, tty, none)

9Front

  • Plan9/9Front :v

SerenityOS

  • SerenityOS

Tested and supported platforms:

  • Windows
  • MacOS
  • Linux: both GNU and Busybox and both GLibC and Musl
  • Android (requires Termux)
  • Haiku
  • Plan9
  • 9Front
  • FreeBSD (no ascii tho)
  • NetBSD
  • SerenityOS

Platforms where it should work:

a checked box means there is support and someone made it work, but it has not been tested at all.

  • OpenBSD
  • DragonflyBSD
  • MidnightBSD
  • HarveyOS
  • AIX
  • MINIX
  • IRIX
  • FreeMiNT
  • Inferno
  • BeOS (original)
  • OS/2
  • ArcaOS
  • AmigaOS
  • MorphOS
  • iOS (via OpenTerm i guess?)
  • iPadOS (same as iOS)
  • HelenOS

Platforms where it does NOT work (or it should not):

  • Redox (we have hope since we have an actual rust lua interpreter)
  • BlackBerry OS
  • TempleOS (unless someone writes a lua interpreter in holyc i dont see that coming)

Platforms where i have NO IDEA if swef works

  • Vinix (there is VLua and GCC 12 with MLibC was ported, but i am not completely sure it'll work lol)
  • KolibriOS
  • Managram (Maybe? Their LibC (mLibC) seems good enough for Lua)
  • GhostOS

For the rest it should work fine on tons of platforms. At least where Lua is supported, and Lua is built in ANSI C (C89), meaning that it can be compiled nearly everywhere, with some patches. If your os is not supported (e.g. no ascii available or the os is not recognised) you can enjoy a cute cat art that changes breeed randomly as a replacement. If you REALLY want a new ascii art for your system, then please submit a github issue.

Features

  • OS name
  • Window Manager (Non EWMH wm's are comin!) Non EWMH linux wm's are here, plus MacOS, FreeMiNT and Windows WM's support!
  • Kernel
  • Shell 👌

Maybe in the future:

  • Hostname
  • User
  • CPU
  • RAM
  • Disk space
  • Uptime
  • Package Number
  • ???

Dependences

Lua: https://www.lua.org/download.html

xprop (only for X11 systems, e.g. Linux w/ X11, FreeBSD, NetBSD, OpenBSD, Minix etc)

Thats it.

Thanks for using swef.