dylanaraps / neofetch

🖼️ A command-line system information tool written in bash 3.2+
MIT License
22.18k stars 1.66k forks source link

Windows Support #12

Closed ghost closed 8 years ago

ghost commented 8 years ago

using getos, we can add:

    "Windows")
        distro="$(systeminfo | sed -n 's/^OS Name:[[:blank:]]*//p')"

to print the version. Uptime and other statistics can then further be added from the flag by default.

dylanaraps commented 8 years ago

Windows support is actually almost done in my local repo. It'll be finished very soon.

ghost commented 8 years ago

Figures! You've been working very fast... thanks! It works, side from the odd window focus causing the image to disappear from the terminal. In this instance, I was using cygwin.

dylanaraps commented 8 years ago

What terminal emulator did you get the flicker in? There's a flicker issue with vte based terminals that I've been trying to fix.

ghost commented 8 years ago

urxvt - the images wont display in mintty, and I haven't troubleshooted it any. I can test and look into it since I'm probably just missing something in my .minttyrc

dylanaraps commented 8 years ago

I'll boot up my windows vm and work on it now.

dylanaraps commented 8 years ago

Alright.

The only info we're missing now is cpu and memory.

dylanaraps commented 8 years ago

Everything but images should work now.

I'd like you to test if that's alright.

dylanaraps commented 8 years ago

I can't get the images to load in mintty either. I'm installing X11 and Urxvt now to test.

ghost commented 8 years ago

gilliamii_2016-01-05_55

Memory works, OS is a bit vague - uptime isn't working though the code looks ok at a glance. I will have time to test more and look into it tomorrow. I will note i am of course manually using an image with the --image and --size flags since it just wont work any other way right now. It is possible to point it to the active wallpaper in use by pointing to %AppData%\Microsoft\Windows\Themes\TranscodedWallpaper.jpg", but this image is sometimes displayed weird based on monitor position/if its set to tiled/center/what not.

dylanaraps commented 8 years ago

Thanks for testing!

There are options to permanently set these options inside the script.

Thanks for testing!

dylanaraps commented 8 years ago

One more thing, what does this output on your system?

cmd /c ver

Edit: I've pushed windows version detection to master. It works on my machine but I'd still like to test it on others.

Edit2: Wallpaper support for Windows is in master now too.

dylanaraps commented 8 years ago

I've tested the script in both Windows XP and 7 and it seems to be working without issues now. I still can't get images to work in Mintty but they work just fine inside urxvt etc.

If you're having any issues or any ideas let me know.

ghost commented 8 years ago

Thanks for the information on the missing procps package. Here is the cmd /c ver result: gilliamii_2016-01-06_12

Default result (no flags): gilliamii_2016-01-06_45

Suggested font spacing flags: gilliamii_2016-01-06_39

Issues: Dual monitor wallpapers won't display properly, as you can see. Unfortunately, I can't think of a solution that would work for dual monitors - unless there's some registry somewhere that shows a wallpaper from the primary monitor only that I am not aware of. Unless you detect a second monitor for windows specifically, and offset the crop to the image it won't work. Even then, the transcoded wallpaper is weird and it probably just won't ever work with two displays (unless of course, its one solid wallpaper and not two weird offset ones like my unique display). Either way, I personally don't believe it will be a huge issue to the majority of windows users as my displays are retarded.

Suggestions: Alternate shell display. Searching for blackbox, litestep, and other foreign processes that may be running to give a more accurate read on what is actually effecting visual display and theming on Windows.

You are already probably working on some of this as well:

Things like Kernel, and packages, unfortunately may not be relevant for a fetch on windows. You can replace or offer a field with either a "Music" player, or "IRC/Chat" client fields. Primarily, the windows theme is pretty much always applicable and should replace any GTK theme field. All of these are found pretty easily, but it may slow down your script. Having them within the script by default, then just allowing someone to choose what to display from a list would make it easier to use rather than multiple flags and echo/print lines.

I really do appreciate the ability to customize the script with the custom echo/print lines however as you can keep speed while getting the result you want. Result of modifying the script itself: gilliamii_2016-01-06_02

It would be great to see the "scrot"option actually take a screenshot, and have it save to desktop/choice directory.

dylanaraps commented 8 years ago

Thanks for the writeup!

Thanks for the feedback!

I'll get to work.

dylanaraps commented 8 years ago

It'd be really helpful if you could also make a list of the commands you're using to output the Icons, Shell etc. :)

dylanaraps commented 8 years ago

I've added a function to get the current visual style. (getvisualstyle)

I've tested it in a Windows 7 vm and it seems to work fine. Let me know if there are any issues with it.

ghost commented 8 years ago

The icons line was added with just "echo Icons:" and typing it out. Since icons are controlled via imageres.dll, theres no way to really tell what iconpack you have installed. Everything else was pulled from the tasklist.

Crop mode fit/fill dont really fix it, fill is probably the best result as at least it centers the image better.

I use autohotkey with irfanview to take screencaps: http://pastebin.com/raw/JTwRtuQy

dylanaraps commented 8 years ago

Thanks, does the visual style function work? Just add Title Here: getvisualstyle to the array at the top.

Also are you able to upload that full Windows wallpaper file? (The one in the first two screenshots) I want to use it to create a new crop mode.

ghost commented 8 years ago

transcodedwallpaper

I'm actually using multiwall to set it, so when it generates the image it comes out this strange way - i have one monitor sitting higher than the other.

After testing, getvisualstyle isn't giving the full name of the visual style, it just says "custom".

dylanaraps commented 8 years ago

Custom is the default name for unamed themes on Windows iirc.

How are you setting the themes and are they named?

ghost commented 8 years ago

Good thinking. I do normally set them directly within Ave Style builder, which names the .msstyle and will show in the fetch properly. However I have been adjusting the window options (border and captions) recently within the personalization panel, and so the theme was showing as "unsaved". So yes, it will read the theme name as displayed in "Personalization"

ghost commented 8 years ago

One more thing, is it possible for the script to randomly choose an image from a directory?

dylanaraps commented 8 years ago

That's a great idea!

Will do.

dylanaraps commented 8 years ago

Image shuffling is in master now.

Edit: Taking a screenshot is in master now too. right now it requires "scrot" but I'll add an option to specify a custom command later on. --scrotcmd and $scrotcmd

You can use the flags -s or --scrot to take a screenshot.

dylanaraps commented 8 years ago

I installed multiwall and did some digging, what does the image stored here look like?

C:/Users/USER/AppData/Roaming/MultiWall/wallpaper.bmp

I'm hoping that that's the wallpaper pre-jumble. If it is then you can just launch fetch with --image (or set $image) to that and it'll work.

dylanaraps commented 8 years ago

I'm a little stuck with trying to figure out how to get any other info on Windows without checking currently running processes against an array, the script is already way slower on Windows and this would bring it to a crawl especially if the item is near the end of the array.

I'm also a little confused about the shell part on Windows. I know that the shell on windows is the desktop itself but I had a look at your Windows 7 rice page and under "Shell" it shows Blackbox/Litestep with Bash/Zsh together.

I'll keep working on this but the Windows portion of the script is already on feature parity with Linux/Mac OS X so It won't be a very high priority unless there's a larger demand for it. Pull requests are welcome if they meet the standards of the rest of the script.

In the meantime your only option is to edit the array at the top of the script and add the Music player, Irc etc manually. If the script runs bug free for you then I'll close this issue as I think it's feature complete.

Thanks for your help!

ghost commented 8 years ago

The shell section of nanami-tan is misleading, and I plan to change that alongside updating the cygwin area in general. It's not something I really like going into detail about on a windows related website, but it is unavoidable.

http://win-bash.sourceforge.net/ https://babun.github.io/ http://zsh-nt.sourceforge.net/

some examples of urls and general updates that need to be pushed.

I am in agreement that the features you have added for windows are more than sufficient and thank you for supporting it. I think it should be easy enough for someone to figure out how to modify the script to reflect accurate information should they choose to use it.

dylanaraps commented 8 years ago

Thanks for all the help!

dylanaraps commented 8 years ago

Neofetch now detects and shows some WMs/Shells by parsing tasklist.

See these PRs: #373 #374 #375

Support:

WM is shown like this:

WM: Bugn, Explorer
WM: BbLean (Blackbox), Explorer
WM: Litestep, Explorer

I know that showing Blackbox, Litestep and Emerge under WM is a little misleading and it's because I'm not sure entirely on how to differentiate between terminal shell and windows shell.

Any ideas @xDemonessx?

ghost commented 8 years ago

Sorry for a delayed reply, I've been out of town. The thing about displaying WMs such as bblean and bugn is that technically its still either dwm managing the windows, or bblean skin (plugin) styling them, or autohotkey moving them around.

Detecting that these processes are running and then displaying them as you have shown is a great idea, and probably the best/most logical way of going about it. I doubt theres any way/reason to show "bbleanskin" is styling a window over an aero theme, or showing an autokey script (like bug.n) is being used to tile and move windows around... in the end most people will rely on aero/dwm and in truth thats what all windows users are probably sticking with when it comes to window management and themes.

My interpretation is this : blackbox, emerge, and litestep are shell replacements - bug.n/ahk is the window managment, and aero + dwm are themes.

😕