Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Use 'xprop' instead of 'wmctrl' to get the window manager. #79

Merged
merged 4 commits into from
Feb 17, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 1.2.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ fixes issues where the wallpaper set by gsettings is an xml file.
- Added support for showing the user's DE.

**Window Manager**:
- `wmctrl` is now a required dependency. See **[#75](https://github.com/dylanaraps/fetch/issues/75)**.
- `xprop` is now a required dependency. See **[#79](https://github.com/dylanaraps/fetch/issues/79)**
- Renamed 'windowmanager' to 'wm'

**IP Address**:
Expand Down
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,10 @@ your distro's logo or any ascii art of your choice!
### Required dependencies:

- `Bash 4.0+`
- `xprop` \[3\]
- `procps-ng`
- Not required on OS X

##### Linux / BSD

- `wmctrl` \[3\]


### Optional dependencies:

Expand All @@ -93,7 +90,7 @@ your distro's logo or any ascii art of your choice!
\[2\] You can enable the `iTerm2` image backend by using the launch flag `--image_backend iterm2` or by<br \>
changing the config option `$image_backend` to `iterm2`.

\[3\] See **#75** about why this is now a required dependency.
\[3\] See **[#79](https://github.com/dylanaraps/fetch/issues/79)** about why this is now a required dependency.

\[4\] You can use the launch flag `--scrot_cmd` or change the config option `$scrot_cmd` to your screenshot<br \>
program's cmd and fetch will use it instead of scrot.
Expand Down
13 changes: 8 additions & 5 deletions fetch
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@
#
# Required Dependencies:
# Bash 4.0+
# Text formatting, dynamic image size and padding: tput
# xprop
# [Linux / BSD / Windows] Uptime detection: procps or procps-ng
#
# Optional Dependencies: (You'll lose these features without them)
# Displaying Images: w3m + w3m-img
# Image Cropping: ImageMagick
# More accurate window manager detection: wmctrl
# [ Linux / BSD ] Wallpaper Display: feh, nitrogen or gsettings
# [ Linux / BSD ] Current Song: mpc or cmus
# [ Linux / BSD ] Resolution detection: xorg-xdpyinfo
Expand Down Expand Up @@ -746,9 +745,13 @@ getde () {
# Window Manager {{{

getwm () {
if type -p wmctrl >/dev/null 2>&1; then
wm="$(wmctrl -m | head -n1)"
wm=${wm/Name: }
if [ -n "$DISPLAY" ]; then
id="$(xprop -root -notype | \awk '$1=="_NET_SUPPORTING_WM_CHECK:"{print $5}')"
wm="$(xprop -id "$id" -notype -f _NET_WM_NAME 8t)"
wm=${wm/*_NET_WM_NAME = }
wm=${wm/\"}
wm=${wm/\"*}

else
case "$os" in
"Mac OS X") wm="Quartz Compositor" ;;
Expand Down