dm-tool utility:dm-tool switch-to-greeter
dm-tool utility:dm-tool switch-to-greeter
Fix the host name and the user name accordingly. Then add a line like this to /etc/ppp/chap-secrets:remotename myvpn linkname myvpn ipparam myvpn pty "pptp <host> --nolaunchpppd " name <username> usepeerdns require-mppe refuse-eap noauth # adopt defaults from the pptp-linux package file /etc/ppp/options.pptp
<username> myvpn <password> *
/etc/ppp/ip-down.d/myvpn:#!/bin/bash if [[ $PPP_LOCAL = 192.168.2.* ]]; then route del default gw 192.168.1.1 route add default gw 192.168.2.100 fi
Don't forget to make the scripts executable. Also notice that ip-up.d/ and ip-down.d/ are only available in Debian and its derivatives (to learn more about the arguments passed to them and the available environment variables, see the Debian /etc/ppp/ip-up and /etc/ppp/ip-down scripts). Other distros use slightly different paths.#!/bin/bash if [[ $PPP_LOCAL = 192.168.2.* ]]; then route add default gw 192.168.1.1 route del default gw 192.168.2.100 fi
Also, if you like to have tabs, you can run urxvt likeURxvt*background: #000000 URxvt*foreground: #00ff00 ! black URxvt.color0 : #000000 URxvt.color8 : #555555 ! red URxvt.color1 : #AA0000 URxvt.color9 : #FF5555 ! green URxvt.color2 : #00AA00 URxvt.color10 : #55FF55 ! yellow URxvt.color3 : #AA5500 URxvt.color11 : #FFFF55 ! blue URxvt.color4 : #0000AA URxvt.color12 : #5555FF ! magenta URxvt.color5 : #AA00AA URxvt.color13 : #FF55FF ! cyan URxvt.color6 : #00AAAA URxvt.color14 : #55FFFF ! white URxvt.color7 : #AAAAAA URxvt.color15 : #FFFFFF URxvt*font: xft:Monospace:pixelsize=18 URxvt*letterSpace: -1 URxvt.perl-ext-common : default,matcher URxvt.urlLauncher : firefox URxvt.matcher.button : 1 ! scrollbar style - rxvt (default), plain (most compact), next, or xterm URxvt.scrollstyle: plain URxvt.perl-ext-common: default,tabbed
urxvt -pe tabbed, or you can add this line to your .Xdefaults.URxvt.perl-ext-common: default,tabbedIn order to open a new tab, press C-M-Down (that is, control and alt and down arrow). To switch tabs use C-M-Left and C-M-Right. To move the current tab, use C-Left and C-Right. I wish I could change these key bindings since the arrow keys are two far away from my comfort zone, but I haven't find a way to do that, yet. Well, nothing is perfect!
If you're ever in doubt about the class attribute of a certain window, just switch to it, press(defcommand urxvt () () "Start a urxvt instance or switch to it if already running" (run-or-raise "urxvt" '(:class "URxvt"))) (define-key *root-map* (kbd "c") "urxvt") (define-key *root-map* (kbd "C-c") "urxvt")
C-t : and then type in (stumpwm::window-class (stumpwm::current-window)).
Obviously, VLC's telnet interface should be active. I found no way to find out if playback is paused in VLC or not. There are two commands that looked like they should help, but they don't. Telnet command is_playing only returns 0 if playback is stopped, not paused. status command for some reason always says "( state paused )". Anyway, I'm glad that VLC itself can create global key-bindings, so I'm happy with my current situation.;; vlc control. vlc telnet interface should be enabled. (defcommand vlc-play () () "start/resume vlc playback" (telnetlib:with-telnet-session (tn "localhost" 4212) (telnetlib:read-until tn "Password: ") (telnetlib:write-ln tn "admin") (telnetlib:read-until tn "> ") (telnetlib:write-ln tn "play") (telnetlib:read-until tn "> ") (telnetlib:write-ln tn "quit"))) (defcommand vlc-pause () () "pause vlc playback" (telnetlib:with-telnet-session (tn "localhost" 4212) (telnetlib:read-until tn "Password: ") (telnetlib:write-ln tn "admin") (telnetlib:read-until tn "> ") (telnetlib:write-ln tn "pause") (telnetlib:read-until tn "> ") (telnetlib:write-ln tn "quit")))
The check-mail function uses the clonsigna package (for IMAP). When there is unread mail, it sets the SCROLL LOCK LED to blink for one second every five seconds. It also sets the global variable *unread-mail-count* to the number of unread messages.;; mail notification (defvar *unread-mail-count* 0) (defcommand check-mail () () "Checks an email account and if there is unread mail in the inbox makes the scroll lock led to slowly blink. Returns the number of unread messages. Needs the ledcontrol command available and the ledd daemon pipe file (/var/run/ledd-pipe by default) should be accessible by normal users." (let ((sock (clonsigna:make-imap :host "imap.gmail.com" :port 993 :ssl-p t))) (unwind-protect (progn (clonsigna:cmd-connect sock) (clonsigna:cmd-login sock "username" "password") (clonsigna:cmd-select sock "inbox") ;; cmd-search will return something like (("* SEARCH 2461 ;; 2465 2471")) The numbers are message ids, that's why we ;; split the string by spaces, count the parts and then ;; subtract two for the "* SEARCH" part (setf *unread-mail-count* ( - (length (cl-utilities:split-sequence #\Space (first (clonsigna:cmd-search sock :criteria "UnSeen")))) 2)) ;; if there is unread mail, have the scroll lock led blink ;; for one second every five seconds (if (zerop *unread-mail-count*) (run-shell-command "ledcontrol set s9 off") (run-shell-command "ledcontrol set s9 dutycycle 5000 1 100 20")) *unread-mail-count*) (clonsigna:cmd-close sock)))) (defvar *mail-notification-timer* (run-with-timer 1 120 'check-mail))
amixer sset Master 5%+ which simply raises the master volume by 5 percent. That line also prints out the current volume (among other things) which we will use in order to show the user the current volume. I've added this snippet to my .stumpwmrc file:This defines three commands (volume-up, volume-down and volume-mute-toggle) and binds them to the multimedia volume control keys. This works fine on my computer. If the multimedia keys are not available for you, this page suggests adding these lines:;; setup volume control key bindings (defcommand volume-up () () "Increases master volume by 5 percent." (let ((result (run-shell-command "amixer sset Master 5%+" t))) (cl-ppcre:register-groups-bind (pct) ("\\[(\\d+)%\\]" result) (message "~a%" pct)))) (define-key *top-map* (kbd "XF86AudioRaiseVolume") "volume-up") (defcommand volume-down () () "Increases master volume by 5 percent." (let ((result (run-shell-command "amixer sset Master 5%-" t))) (cl-ppcre:register-groups-bind (pct) ("\\[(\\d+)%\\]" result) (message "~a%" pct)))) (define-key *top-map* (kbd "XF86AudioLowerVolume") "volume-down") (defcommand volume-mute-toggle () () "Mutes/Unmutes the master volume." (let ((result (run-shell-command "amixer sset Master toggle" t))) (cl-ppcre:register-groups-bind (state) ("\\[(on|off)\\]" result) (if (equalp state "off") (message "muted.") (message "unmuted."))))) (define-key *top-map* (kbd "XF86AudioMute") "volume-mute-toggle")
UPDATE: I just noticed that the code for mute does not work on my Desktop (with Ubuntu Precise) though it's perfectly fine on my laptop (which runs Debian Squeeze). After some poking around, I found out that apparently when pulseaudio is present, amixer cannot unmute sound. I looked around for a pulseaudio equivalent and found pactl. But unlike amixer, pactl does not print out the current state of things after running a command and it also (as far as I know) does not provide a toggle command. What I did was to run(define-keysym #x1008ff11 "XF86AudioLowerVolume") (define-keysym #x1008ff12 "XF86AudioMute") (define-keysym #x1008ff13 "XF86AudioRaiseVolume")
pactl list first. This command prints out a lot of information from which we can find out if sound is muted or not. In the following snippet, I'm using a very simplistic regular expression to extract this information. It might not work correctly on a different setup
(defcommand volume-mute-toggle () () "Mutes/Unmutes the master volume." (cl-ppcre:register-groups-bind (state) ("Mute: (yes|no)" (run-shell-command "pactl list" t)) (cond ((equalp state "yes") (run-shell-command "pactl set-sink-mute 0 0") (message "unmuted.")) (t (run-shell-command "pactl set-sink-mute 0 1") (message "muted.")))))
In order to use Terminus as my console (tty) font, I simply installed the package terminus-font with pacman (includes both console and X11 ...