Skip to content
/ wmenu Public
forked from LinArcX/wmenu

A dmenu clone for windows operating system written with pure win32 API.

License

Notifications You must be signed in to change notification settings

sheepla/wmenu

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wmenu

A dmenu clone for the Windows operating system written with pure win32 API.

wmenu is a hybrid GUI/terminal application inspired by dmenu. But it's more than that. It's better to see wmenu as "a GUI echo" utility.

If you pass a list of items to it via: -elements option, wmenu shows you a ComboBox and and you're able to select one of them. After that, it echos back that item on your terminal.

If you omit -elements, wmenu starts acting like a GUI TextBox. Now you can type something and by pressing ENTER, it will echo the content of TextBox on the screen.

Demo

Application launcher: application_launcher

Jump to favorite directories: jump_to_favorite_dirs

PowerManager: power_manager

Why?

  1. The main reason is that: I missed my Linux workflow.

    When I met dmenu for the first time, I said to myself: "This simple tool can change my workflow completely", And surprisingly it did! I started to use dmenu to automate almost everything in my machine. From searching through applications, managing software(installing/deleting/updating), running custom scripts, browsing through my favorite directories, playing music, etc...

    But the problem is that dmenu uses Xlib under the hood which is not available on Windows. There are some hacky ways like compiling dmenu using Cygwin, but.. no. I didn't like those ways.

    So I started from scratch to clone dmenu using win32 API, without any emulation. This is how wmenu was born :)

  2. The second reason is that I wanted to encourage people to challenge their habits. (even if you are a programmer or not.) Microsoft tried so hard during the last years(And they are trying now more than before) to force people to use Windows in a specific way. They pay huge amounts of money to engineers to create a palace!(default environment) In the end, you will become a good user(follower!) But man! it's the computer world. No one can tell you HOW you can use your computer.

Prerequisites

  • MSVC

How use it?

Since wmenu uses the WINDOWS subsystem when compiling, you can't use stdout directly.

So you should pipe it with more command:

wmenu.exe -elements "wmenu,dmenu,dwm" | more

Or if you want to use a specific delimiter:

wmenu.exe -element-delimiter ":" -elements "wmenu:dmenu:dwm" | more

For more information about how using wmenu: wmenu.exe -help | more

Usage

Let's create a file called apps.bat and paste these lines into it:

@echo off
start /B wmenu.exe -elements "notepad;explorer;paint;" | more > %temp%/apps.txt

for /f "tokens=*" %%s in (%temp%\apps.txt) do (
  IF "%%s"=="notepad" (
	start %%s
  ) ELSE IF "%%s"=="explorer" (
	start %%s
  ) ELSE IF "%%s"=="paint" (
	start mspaint
  ) ELSE (
	REM default case...
  )
)

del "%temp%\apps.txt"

You can use clavier+ to bind it to a key.

As i said, i use wmenu for almost anything. Enjoy hacking your workflow :)

Philosophy behind code structure

  1. I intentionally changed/removed some policies that are common in the UNIX world (you can see them in most Linux software like dmenu).
  2. I don't like passing a list of elements by piping(something used in suckless dmenu). Instead, I prefer to explicitly pass them via -elements option.
  3. I'm not a big fan of having two kinds of option names(short names like -e and long ones like --elements). Instead, I prefer to use full and descriptive names. (-elements)

License

License

About

A dmenu clone for windows operating system written with pure win32 API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 100.0%