From bbace2976d09892bcc15514d487e571811202683 Mon Sep 17 00:00:00 2001 From: Felix Van der Jeugt Date: Sat, 18 Apr 2015 21:28:33 +0200 Subject: [PATCH] Revert removal of xinitrc and cleanup --- .../user/default.target.wants/dunst.service | 1 - .../user/default.target.wants/feh.service | 1 - .../default.target.wants/redshift.service | 1 - .../default.target.wants/xautolock.service | 1 - .../user/default.target.wants/xcape.service | 1 - .../user/default.target.wants/xset.service | 1 - config/systemd/user/dunst.service | 10 ---- config/systemd/user/feh.service | 11 ----- config/systemd/user/redshift.service | 10 ---- config/systemd/user/xautolock.service | 10 ---- config/systemd/user/xcape.service | 10 ---- config/systemd/user/xset.service | 10 ---- xinitrc | 47 +++++++++++++++++++ xmonad/xmonad.hs | 7 ++- 14 files changed, 52 insertions(+), 69 deletions(-) delete mode 120000 config/systemd/user/default.target.wants/dunst.service delete mode 120000 config/systemd/user/default.target.wants/feh.service delete mode 120000 config/systemd/user/default.target.wants/redshift.service delete mode 120000 config/systemd/user/default.target.wants/xautolock.service delete mode 120000 config/systemd/user/default.target.wants/xcape.service delete mode 120000 config/systemd/user/default.target.wants/xset.service delete mode 100644 config/systemd/user/dunst.service delete mode 100644 config/systemd/user/feh.service delete mode 100644 config/systemd/user/redshift.service delete mode 100644 config/systemd/user/xautolock.service delete mode 100644 config/systemd/user/xcape.service delete mode 100644 config/systemd/user/xset.service create mode 100644 xinitrc diff --git a/config/systemd/user/default.target.wants/dunst.service b/config/systemd/user/default.target.wants/dunst.service deleted file mode 120000 index f7541d4..0000000 --- a/config/systemd/user/default.target.wants/dunst.service +++ /dev/null @@ -1 +0,0 @@ -/home/felix/dotfiles/config/systemd/user/dunst.service \ No newline at end of file diff --git a/config/systemd/user/default.target.wants/feh.service b/config/systemd/user/default.target.wants/feh.service deleted file mode 120000 index c60c3f1..0000000 --- a/config/systemd/user/default.target.wants/feh.service +++ /dev/null @@ -1 +0,0 @@ -/home/felix/dotfiles/config/systemd/user/feh.service \ No newline at end of file diff --git a/config/systemd/user/default.target.wants/redshift.service b/config/systemd/user/default.target.wants/redshift.service deleted file mode 120000 index bdba747..0000000 --- a/config/systemd/user/default.target.wants/redshift.service +++ /dev/null @@ -1 +0,0 @@ -/home/felix/dotfiles/config/systemd/user/redshift.service \ No newline at end of file diff --git a/config/systemd/user/default.target.wants/xautolock.service b/config/systemd/user/default.target.wants/xautolock.service deleted file mode 120000 index 8629e49..0000000 --- a/config/systemd/user/default.target.wants/xautolock.service +++ /dev/null @@ -1 +0,0 @@ -/home/felix/dotfiles/config/systemd/user/xautolock.service \ No newline at end of file diff --git a/config/systemd/user/default.target.wants/xcape.service b/config/systemd/user/default.target.wants/xcape.service deleted file mode 120000 index f1688ff..0000000 --- a/config/systemd/user/default.target.wants/xcape.service +++ /dev/null @@ -1 +0,0 @@ -/home/felix/dotfiles/config/systemd/user/xcape.service \ No newline at end of file diff --git a/config/systemd/user/default.target.wants/xset.service b/config/systemd/user/default.target.wants/xset.service deleted file mode 120000 index b79a0c9..0000000 --- a/config/systemd/user/default.target.wants/xset.service +++ /dev/null @@ -1 +0,0 @@ -/home/felix/dotfiles/config/systemd/user/xset.service \ No newline at end of file diff --git a/config/systemd/user/dunst.service b/config/systemd/user/dunst.service deleted file mode 100644 index 7a8bdea..0000000 --- a/config/systemd/user/dunst.service +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=Dunst Notification Daemon -After=display-manager.service -Wants=display-manager.service - -[Service] -ExecStart=/usr/bin/dunst - -[Install] -WantedBy=default.target diff --git a/config/systemd/user/feh.service b/config/systemd/user/feh.service deleted file mode 100644 index 0ce4191..0000000 --- a/config/systemd/user/feh.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=Feh Background Image Loader -After=display-manager.service -Wants=display-manager.service - -[Service] -Type=oneshot -ExecStart=/usr/bin/feh --bg-scale '/home/felix/Pictures/lain.png' - -[Install] -WantedBy=default.target diff --git a/config/systemd/user/redshift.service b/config/systemd/user/redshift.service deleted file mode 100644 index 89ebb10..0000000 --- a/config/systemd/user/redshift.service +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=Redshift -After=display-manager.service -Wants=display-manager.service - -[Service] -ExecStart=/usr/bin/redshift - -[Install] -WantedBy=default.target diff --git a/config/systemd/user/xautolock.service b/config/systemd/user/xautolock.service deleted file mode 100644 index 1111877..0000000 --- a/config/systemd/user/xautolock.service +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=X Autolocker -After=display-manager.service -Wants=display-manager.service - -[Service] -ExecStart=/usr/bin/xautolock -time 1 -locker xsecurelock - -[Install] -WantedBy=default.target diff --git a/config/systemd/user/xcape.service b/config/systemd/user/xcape.service deleted file mode 100644 index 390b568..0000000 --- a/config/systemd/user/xcape.service +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=XCape Modifier Key Modifier -After=display-manager.service -Wants=display-manager.service - -[Service] -ExecStart=/usr/bin/xcape -d -t 100 -e 'Super_L=Scroll_Lock;Shift_L=Escape' - -[Install] -WantedBy=default.target diff --git a/config/systemd/user/xset.service b/config/systemd/user/xset.service deleted file mode 100644 index 0f33410..0000000 --- a/config/systemd/user/xset.service +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=Set screen timeout properties -After=display-manager.service -Wants=display-manager.service - -[Service] -ExecStart=/usr/bin/xset dpms 0 0 50 s off - -[Install] -WantedBy=default.target diff --git a/xinitrc b/xinitrc new file mode 100644 index 0000000..79a96eb --- /dev/null +++ b/xinitrc @@ -0,0 +1,47 @@ +#!/bin/sh + +userresources=$HOME/.Xresources +usermodmap=$HOME/.Xmodmap +sysresources=/etc/X11/xinit/.Xresources +sysmodmap=/etc/X11/xinit/.Xmodmap + +# merge in defaults and keymaps + +if [ -f $sysresources ]; then + xrdb -merge $sysresources +fi + +if [ -f $sysmodmap ]; then + xmodmap $sysmodmap +fi + +if [ -f "$userresources" ]; then + xrdb -merge "$userresources" +fi + +if [ -f "$usermodmap" ]; then + xmodmap "$usermodmap" +fi + +# start some nice programs +if [ -d /etc/X11/xinit/xinitrc.d ] ; then + for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do + [ -x "$f" ] && . "$f" + done + unset f +fi + +# Forking graphical programs +forklog() { + nohup $* | logger & +} + +forklog redshift +forklog dunst +forklog xcape -t 100 -e 'Super_L=Scroll_Lock;Shift_L=Escape' +forklog feh --bg-scale '/home/felix/Pictures/lain.png' +forklog xautolock -time 1 -locker xsecurelock & +forklog xset dpms 0 0 50 s off & + +# Start herbstluftwm in locked mode. Is unlocked after autostart. +exec xmonad diff --git a/xmonad/xmonad.hs b/xmonad/xmonad.hs index abcb741..dd8b63d 100644 --- a/xmonad/xmonad.hs +++ b/xmonad/xmonad.hs @@ -37,7 +37,10 @@ myTerminal :: [Char] myTerminal = "urxvtc" runInTerminal :: [Char] -> [Char] -> [Char] -runInTerminal e n = myTerminal ++ " -name " ++ n ++ " -e " ++ e ++ " > /dev/null 2>&1" +runInTerminal e n = myTerminal ++ " -name " ++ n ++ " -e " ++ e + +logged :: [Char] -> [Char] +logged m = "nohup " ++ m ++ " | logger" -- Whether focus follows the mouse pointer. myFocusFollowsMouse :: Bool @@ -119,7 +122,7 @@ myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $ [ ((modm .|. shiftMask, xK_Return), spawn $ XMonad.terminal conf) -- launch dmenu - , ((0, xK_Scroll_Lock), spawn "PATH=\"/home/felix/.local/bin:$PATH\" dmenu_run") + , ((0, xK_Scroll_Lock), spawn $ logged "dmenu_run") -- close focused window , ((modm .|. shiftMask, xK_c ), kill)