Permalink
Browse files

Simplify desktop entry file

  • Loading branch information...
1 parent 5f74f08 commit 2b5cf373dd3c96dc0c5c3b44fef911ab47f2712a @baskerville committed Aug 16, 2015
Showing with 3 additions and 70 deletions.
  1. +0 −2 Makefile
  2. +0 −65 contrib/freedesktop/bspwm-session
  3. +3 −3 contrib/freedesktop/bspwm.desktop
View
@@ -46,7 +46,6 @@ install:
mkdir -p "$(DESTDIR)$(BINPREFIX)"
cp -pf bspwm "$(DESTDIR)$(BINPREFIX)"
cp -pf bspc "$(DESTDIR)$(BINPREFIX)"
- cp -p contrib/freedesktop/bspwm-session "$(DESTDIR)$(BINPREFIX)"
mkdir -p "$(DESTDIR)$(MANPREFIX)"/man1
cp -p doc/bspwm.1 "$(DESTDIR)$(MANPREFIX)"/man1
cp -Pp doc/bspc.1 "$(DESTDIR)$(MANPREFIX)"/man1
@@ -63,7 +62,6 @@ install:
uninstall:
rm -f "$(DESTDIR)$(BINPREFIX)"/bspwm
rm -f "$(DESTDIR)$(BINPREFIX)"/bspc
- rm -f "$(DESTDIR)$(BINPREFIX)"/bspwm-session
rm -f "$(DESTDIR)$(MANPREFIX)"/man1/bspwm.1
rm -f "$(DESTDIR)$(MANPREFIX)"/man1/bspc.1
rm -f "$(DESTDIR)$(BASHCPL)"/bspc
@@ -1,65 +0,0 @@
-#! /bin/bash
-#
-# bspwm-session
-#
-# This script is a session launcher for bspwm.
-# It is based on similar scripts included with Openbox.
-
-if [ -n "$1" ]; then
- echo "Usage: bspwm-session"
- echo
- exit 1
-fi
-
-# Multi-user support:
-state_prefix=${XDG_CACHE_HOME:-"$HOME/.cache"}
-mkdir -p "${state_prefix}"
-
-if [ ! -d "${state_prefix}" ]; then
- echo "bspwm-session: cache directory ‘${state_prefix}‘ is missing."
- echo
- exit 1
-elif [ ! -w "${state_prefix}" ]; then
- echo "bspwm-session: cache directory ‘${state_prefix}‘ is not writable."
- echo
- exit 1
-fi
-
-state_path=$(mktemp -d "${state_prefix}/bspwm-session.XXXXXX")
-
-if [ $? -ne 0 ]; then
- echo "bspwm-session: failed to create state directory ‘${state_path}‘."
- echo
- exit 1
-fi
-
-export BSPWM_SOCKET=${state_path}/bspwm-socket
-
-# Trap: make sure everything started in ~/.config/bspwm/autostart is
-# signalled when this script exits or dies. Also clean up $state_path.
-function on_exit {
- for child in $(jobs -p); do
- jobs -p | grep -q $child && kill $child
- done
- # Extra paranoia
- [[ -d "${state_path}" && -w "${state_path}" ]] && rm -rf -- "${state_path}"
-}
-
-trap on_exit EXIT SIGHUP SIGINT SIGTERM
-
-# Environment and autostart:
-source_these=(
- "/etc/profile"
- "${HOME}/.profile"
- "${XDG_CONFIG_HOME:-"$HOME/.config"}/bspwm/autostart"
-)
-
-for file in "${source_these[@]}"; do
- [ -r "${file}" ] && . "${file}"
-done
-
-# Launch sxhkd:
-sxhkd &
-
-# Launch bspwm:
-bspwm
@@ -1,6 +1,6 @@
[Desktop Entry]
Encoding=UTF-8
Name=bspwm
-Comment=Launch a bspwm session
-Exec=/usr/bin/bspwm-session
-Type=XSession
+Comment=Binary space partitioning window manager
+Exec=bspwm
+Type=Application

6 comments on commit 2b5cf37

ijks replied Aug 17, 2015

Does this still allow running bspwm from a display manager? Doesn't it need to a session file to launch it?

Yes, you can still run bspwm from a DM; no you do not need a session file.

If you have been using bspwm-session and are transitioning from that, you will probably need to account for

  • starting sxhkd (using, e.g., ~/.config/bspwm/bspwmrc),
  • autostarting programs (same), and
  • making sure your environment is okay (your DM may source ~/.profile or ~/.xprofile or similar for you).

bspwm will handle $BSPWM_SOCKET fine on its own.

EDIT: you can, of course, keep using bspwm-session locally as there's nothing inherently wrong with it.

ijks replied Aug 18, 2015

Alright, thanks!

Why was this decision made to remove bspwm-session. Was a good default.

Contributor

Lesik replied Mar 15, 2016

According to the freedesktop specifications, possible values for the Type key are Application, Link and Directory, XSession is not valid. Distributions which require strict compliance to specifications were not able to package bspwm (not without manual patches at least) until this change was made.

Unfortunately, the 0.9 release of bspwm still includes the old bspwm.desktop file.

https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s05.html

Contributor

Lesik replied Sep 17, 2016

This was fixed in 0.9.1. Thank you.

Please sign in to comment.