Commits

OJ Reeves committed c8870c6

Added wifi signal, volume, and fixed M-q

  • Participants
  • Parent commits 72f5f5a

Comments (0)

Files changed (4)

File bin/volume.sh

+#!/bin/bash
+#vol=$(amixer get Master | awk -F'[]%[]' '/%/ {if ($7 == "off") { print "MM" } else { print $2/10 }}' | head -n 1)
+vol=$(amixer get Master | awk -F'[]%[]' '/%/ {if ($7 == "off") { print "MM" } else { print $2/10 }}' | head -n 1)
+
+echo Vol: $vol
+
+exit 0

File bin/wireless.sh

+#!/bin/sh
+
+iwconfig wlan0 2>&1 | grep -q no\ wireless\ extensions\. && {
+  echo wired
+  exit 0
+}
+
+essid=`iwconfig wlan0 | awk -F '"' '/ESSID/ {print $2}'`
+stngth=`iwconfig wlan0 | awk -F '=' '/Quality/ {print $2}' | cut -d '/' -f 1`
+bars=`expr $stngth / 10`
+
+case $bars in
+  0)  bar='[----------]' ;;
+  1)  bar='[/---------]' ;;
+  2)  bar='[//--------]' ;;
+  3)  bar='[///-------]' ;;
+  4)  bar='[////------]' ;;
+  5)  bar='[/////-----]' ;;
+  6)  bar='[//////----]' ;;
+  7)  bar='[///////---]' ;;
+  8)  bar='[////////--]' ;;
+  9)  bar='[/////////-]' ;;
+  10) bar='[//////////]' ;;
+  *)  bar='[----!!----]' ;;
+esac
+
+echo $essid $bar
+
+exit 0

File xmobar/.xmobarrc

                     , Run StdinReader
                     , Run Com "uname" ["-s","-r"] "" 36000
                     , Run Date "%a %b %_d %H:%M:%S" "date" 10
+                    , Run Com "$HOME//bin/wireless.sh" [] "wifi" 30
+                    , Run Com "$HOME//bin/volume.sh" [] "vol" 5
                     ]
        , sepChar = "%"
        , alignSep = "}{"
-       , template = "%StdinReader% } %cpu% | %memory% * %swap% | %wlan0% { <fc=#ee9a00>%date%</fc> | %YBBN% | %uname%"
+       , template = "%StdinReader% } %cpu% | %memory% * %swap% | %wlan0% %wifi%   %vol% { <fc=#ee9a00>%date%</fc> | %YBBN% | %uname%"
        }

File xmonad/xmonad.hs

 import XMonad.Hooks.ManageHelpers
 import XMonad.Layout.Maximize
 import XMonad.Util.EZConfig (additionalKeys)
-import XMonad.Util.Run (spawnPipe)
+import XMonad.Util.Run (spawnPipe, unsafeSpawn)
 import qualified Data.Map as M
 import qualified XMonad.StackSet as W
 
       xmonad $ defaultConfig
                 { modMask = mod4Mask
                 , terminal = myTerminal
+                , workspaces = ["1:dev","2:web","3:twt","4:im"] ++ map show [5..9]
                 , focusedBorderColor = myFocusedBorderColour
                 --, manageHook = manageDocks <+> myManageHook
                 , manageHook = manageDocks <+> myManageHook <+> manageHook defaultConfig
                 , layoutHook = avoidStruts $ layoutHook defaultConfig
                 , logHook = dynamicLogWithPP xmobarPP
                             { ppOutput = hPutStrLn xmproc
-                            , ppHiddenNoWindows = xmobarColor "grey" ""
-                            , ppTitle = xmobarColor "green" "" . shorten 85
+                            --, ppHiddenNoWindows = xmobarColor "grey" ""
+                            , ppTitle = xmobarColor "green" "" . shorten 60
                             }
                 , borderWidth = myBorderWidth
                 } `additionalKeys`
                 [ ((mod4Mask, xK_r), spawn "exe=`dmenu_path | dmenu -b` && eval \"exec $exe\"")
                 , ((mod4Mask .|. shiftMask, xK_l), spawn "xscreensaver-command -lock")
+                , ((mod4Mask .|. shiftMask, xK_s), spawn "pavucontrol")
+                , ((mod4Mask, xK_q), spawn "xmonad.start --recompile; xmonad.start --restart")
                 , ((mod4Mask, xK_F11), spawn "sudo shutdown -r now")
                 , ((mod4Mask, xK_F12), spawn "sudo shutdown -h now")
 
+
+              -- Media Keys
+              --, ((0, 0x1008ff12), spawn "amixer -q sset PCM toggle") -- XF86AudioMute
+              --, ((0, 0x1008ff11), spawn "amixer -q sset PCM 655- unmute") -- XF86AudioLowerVolume
+              --, ((0, 0x1008ff13), spawn "amixer -q sset PCM 655+ unmute") -- XF86AudioRaiseVolume
+              , ((0, 0x1008ff12), spawn "amixer -q sset Master toggle") -- XF86AudioMute
+              , ((0, 0x1008ff11), spawn "amixer -q sset Master 3- unmute") -- XF86AudioLowerVolume
+              , ((0, 0x1008ff13), spawn "amixer -q sset Master 3+ unmute") -- XF86AudioRaiseVolume
+
+                --, ((mod4Mask .|. shiftMask, xK_p), spawn "scrot $HOME/Pictures/Screen-%Y%m%d-%H%M%S.png -d 1")
+                --, ((mod4Mask .|. shiftMask, xK_p), spawn "scrot")
+                --
+                --
+                --
+                --
+                --
+
+-- <function/media keys>
+    --, ((0 .|. controlMask,         0x1008ff02   ), unsafeSpawn "moodlight -m") -- maximum screen brightness ((XF86MonBrightnessUp [max]))
+                --, ((0, 0x1008ff02), unsafeSpawn "moodlight -u") -- increase screen brightness ((XF86MonBrightnessUp))
+                --, ((0, 0x1008ff02), unsafeSpawn "moodlight -d") -- increase screen brightness ((XF86MonBrightnessUp))
+    --, ((0,                         0x1008ff12   ), unsafeSpawn "mossrat -m")   -- mute volume, via "mossrat" ((XF86AudioMute))
+    --, ((0,                         0x1008ff11   ), unsafeSpawn "mossrat -d 1") -- decrease volume, via "mossrat" ((XF86AudioLowerVolume))
+    --, ((0,                         0x1008ff13   ), unsafeSpawn "mossrat -i 1") -- increase volume, via "mossrat" ((XF86AudioRaiseVolume))
+
+                --, ((0, xK_Print), unsafeSpawn "import -window root $HOME/Pictures/$(date '+%Y%m%d-%H%M%S').png")
+
+                --, ((0, xK_Print), unsafeSpawn "now=`date '+%Y%m%d-%H%M%S'` && eval \"import -window root $HOME/Pictures/Screenshot-$now.png\"")
+
                 --, ((mod4Mask, xK_Down), setMute False >> lowerVolume 4 >> return ())
                 --, ((mod4Mask, xK_Up), setMute False >> raiseVolume 4 >> return ())
                 --, ((mod4Mask, xK_m), toggleMute >> return ())