diff options
author | toni <matzeton@googlemail.com> | 2016-02-11 18:01:52 +0100 |
---|---|---|
committer | toni <matzeton@googlemail.com> | 2016-02-11 18:01:52 +0100 |
commit | 55fb85a3ea38f898e050c44b71af9765901f9918 (patch) | |
tree | ee54c57aca538ddbde997dd667017d7c3c93a739 /configs | |
parent | 9e6551c1b97638a5a29821837c5e1d07de8f1f4b (diff) |
xmonad update + party mode (= matchbox + projectm + mp3blaster + yt)
Diffstat (limited to 'configs')
-rwxr-xr-x | configs/party-mode/spawn_mp3blaster | 13 | ||||
-rwxr-xr-x | configs/party-mode/spawn_mpsyt | 13 | ||||
-rw-r--r-- | configs/party-mode/xinitrc | 22 | ||||
-rw-r--r-- | configs/xmonad.hs | 73 |
4 files changed, 100 insertions, 21 deletions
diff --git a/configs/party-mode/spawn_mp3blaster b/configs/party-mode/spawn_mp3blaster new file mode 100755 index 0000000..05a8b91 --- /dev/null +++ b/configs/party-mode/spawn_mp3blaster @@ -0,0 +1,13 @@ +#!/bin/bash + +if [ `id -u` -ne 0 ]; then + echo "$0: run with sudo $0" >&2 + exit 1 +fi +SD_USER="${SUDO_USER}" +if [ "x${SD_USER}" = "x" ]; then + echo "$0: run with sudo $0" >&2 + exit 2 +fi +export SD_USER +openvt -l -s -- su -l ${SD_USER} -s /usr/bin/padsp /usr/bin/mp3blaster diff --git a/configs/party-mode/spawn_mpsyt b/configs/party-mode/spawn_mpsyt new file mode 100755 index 0000000..9e0f25e --- /dev/null +++ b/configs/party-mode/spawn_mpsyt @@ -0,0 +1,13 @@ +#!/bin/bash + +if [ `id -u` -ne 0 ]; then + echo "$0: run with sudo $0" >&2 + exit 1 +fi +SD_USER="${SUDO_USER}" +if [ "x${SD_USER}" = "x" ]; then + echo "$0: run with sudo $0" >&2 + exit 2 +fi +export SD_USER +openvt -l -s -- su -l ${SD_USER} -s /usr/local/bin/mpsyt diff --git a/configs/party-mode/xinitrc b/configs/party-mode/xinitrc new file mode 100644 index 0000000..0af0a8b --- /dev/null +++ b/configs/party-mode/xinitrc @@ -0,0 +1,22 @@ +#!/bin/sh + +xset -dpms +xset s noblank +matchbox-window-manager -use_titlebar no -use_desktop_mode plain -use_cursor no & +pulseaudio --fail=false --start & +projectM-pulseaudio & +sleep 5 +sudo /usr/bin/spawn_mp3blaster & +sleep 1 +sudo /usr/bin/spawn_mpsyt & +sleep 2 + +while (`true`); do + pidof mp3blaster >/dev/null + if [ $? -ne 0 ]; then + pulseaudio -k + killall mpsyt + exit 0 + fi + sleep 1 +done diff --git a/configs/xmonad.hs b/configs/xmonad.hs index 54bfbf3..ac45168 100644 --- a/configs/xmonad.hs +++ b/configs/xmonad.hs @@ -1,6 +1,6 @@ --- xmonad config used by Vic Fryzel --- Author: Vic Fryzel +-- Author: Vic Fryzel, Toni Uhlig -- http://github.com/vicfryzel/xmonad-config +-- https://github.com/lnslbrty/foo-scripts/blob/master/configs/xmonad.hs import System.IO import System.Exit @@ -10,8 +10,11 @@ import XMonad.Hooks.ManageDocks import XMonad.Hooks.ManageHelpers import XMonad.Hooks.SetWMName import XMonad.Layout.NoBorders -import XMonad.Layout.Spiral import XMonad.Layout.Tabbed +import XMonad.Layout.Grid +import XMonad.Layout.PerWorkspace +import XMonad.Layout.FixedColumn +import XMonad.Layout.IM import XMonad.Actions.SpawnOn import XMonad.Actions.PhysicalScreens import XMonad.Actions.CycleWS @@ -33,8 +36,13 @@ myTerminal = "x-terminal-emulator" -- Workspaces -- The default number of workspaces (virtual screens) and their names. -- +comWS = "1:com" +fileWS = "2:file" +webWS = "3:web" +w1WS = "4:work1" +w2WS = "5:work2" myWorkspaces :: [WorkspaceId] -myWorkspaces = ["1:pidg","2:file","3:web","4:work1","5:work2"] ++ map show [6..9] +myWorkspaces = [ comWS, fileWS, webWS, w1WS, w2WS ] ++ map show [6..9] ------------------------------------------------------------------------ -- Window rules @@ -44,6 +52,7 @@ myWorkspaces = ["1:pidg","2:file","3:web","4:work1","5:work2"] ++ map show [6..9 -- workspace. -- -- To find the property name associated with a program, use +-- rkspac -- > xprop | grep WM_CLASS -- and click on the client you're interested in. -- @@ -51,20 +60,21 @@ myWorkspaces = ["1:pidg","2:file","3:web","4:work1","5:work2"] ++ map show [6..9 -- 'className' and 'resource' are used below. -- myManageHook = composeAll - [ className =? "Iceweasel" --> doShift "3:web" - , className =? "Chromium" --> doShift "3:web" - , className =? "Icedove" --> doShift "3:web" - , className =? "Pidgin" --> doShift "1:pidg" - , className =? "Eclipse" --> doShift "2:file" - , className =? "Kmail" --> doShift "3:web" - , className =? "Konqueror" --> doShift "2:file" - , className =? "Nautilus" --> doShift "2:file" + [ className =? "Seahorse" --> doShift webWS + , className =? "Iceweasel" --> doShift webWS + , className =? "chromium-browser" --> doShift webWS + , className =? "Icedove" --> doShift webWS + , className =? "Pidgin" --> doShift comWS + , className =? "Eclipse" --> doShift fileWS + , className =? "Kmail" --> doShift webWS + , className =? "Konqueror" --> doShift fileWS + , className =? "Nautilus" --> doShift fileWS , resource =? "desktop_window" --> doIgnore , className =? "Galculator" --> doFloat , className =? "Gource" --> doFloat , className =? "MPlayer" --> doFloat - , className =? "VirtualBox" --> doShift "4:work1" - , className =? "Xchat" --> doShift "5:work2" + , className =? "VirtualBox" --> doShift w1WS + , className =? "Xchat" --> doShift w2WS , isFullscreen --> (doF W.focusDown <+> doFullFloat)] @@ -78,8 +88,23 @@ myManageHook = composeAll -- The available layouts. Note that each layout is separated by |||, -- which denotes layout choice. -- -myLayout = avoidStruts ( - Mirror (Tall 1 (3/100) (1/2)) ||| Tall 1 (3/100) (1/2) ||| Full ||| tabbed shrinkText myTabConfig) +comLayout = + withIM (1/6) (Or + (Title "Buddy-Liste") + (Title "Buddy List")) + Grid +fileLayout = tabbed shrinkText myTabConfig +webLayout = Full +myLayout = avoidStruts $ + onWorkspace comWS comLayout $ + onWorkspace fileWS fileLayout $ + onWorkspace webWS webLayout $ + Mirror (Tall 1 (3/100) (1/2)) ||| + Tall 1 (3/100) (1/2) ||| + Grid ||| + FixedColumn 1 20 80 10 ||| + Full ||| + tabbed shrinkText myTabConfig ------------------------------------------------------------------------ -- Colors and borders @@ -138,11 +163,12 @@ myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $ , ((modMask .|. shiftMask, xK_d), spawn "dmenu_run -b") + -- Take a screenshot from the window on which the user clicks + , ((0, xK_Print), + spawn "xwd -out ~/screenshot.xwd; convert ~/screenshot.xwd ~/screenshot.jpg") -- Take full screenshot in multi-head mode. -- That is, take a screenshot of everything you see. , ((modMask .|. shiftMask, xK_p), - spawn "xwd -out ~/screenshot.xwd; convert ~/screenshot.xwd ~/screenshot.jpg") - , ((modMask .|. shiftMask, xK_o), spawn "xwd -root -out ~/screenshot_full.xwd; convert ~/screenshot_full.xwd ~/screenshot_full.jpg") -- Mute volume. @@ -165,7 +191,7 @@ myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $ , ((modMask .|. shiftMask, xK_x), onNextNeighbour W.view) -- suspend to ram - , ((modMask .|. shiftMask, xK_s), spawn "sudo /usr/sbin/s2ram --force") + , ((modMask .|. shiftMask, xK_s), spawn "xtrlock && sudo /usr/sbin/s2ram --force") -- Close focused window. , ((modMask .|. shiftMask, xK_c), @@ -240,7 +266,9 @@ myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $ -- Quit xmonad. , ((modMask .|. shiftMask, xK_q), - io (exitWith ExitSuccess)) +-- sequence_ [ (spawn "pkill -TERM -P `pgrep -o xmonad`"), (io (exitWith ExitSuccess)) ]) +-- spawn "pkill -TERM -P `pgrep -o xmonad`; sleep 2; killall -TERM -u `id -nu`; sleep 1; kill -TERM `pgrep -o xmonad`") + spawn "/sbin/start-stop-daemon -S -b --exec /usr/bin/killall -- -TERM -u `id -nu`") -- Restart xmonad. , ((modMask, xK_q), @@ -309,9 +337,12 @@ myMouseBindings (XConfig {XMonad.modMask = modMask}) = M.fromList $ --myStartupHook = return () myStartupHook :: X () myStartupHook = do - safeSpawnProg "iceweasel" + safeSpawnProg "seahorse" + safeSpawnProg "chrome" safeSpawnProg "pidgin" setWMName "LG3D" + nextWS + nextWS ------------------------------------------------------------------------ |