Skip to content

Commit

Permalink
fixed formatting - use only tabs, no spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakub Klinkovský committed Sep 12, 2012
1 parent 6321427 commit 5ec919f
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 56 deletions.
75 changes: 38 additions & 37 deletions src/cdm
Expand Up @@ -5,13 +5,13 @@
# Copyright (C) 2009-2011, Daniel J Griffiths <ghost1227@archlinux.us> # Copyright (C) 2009-2011, Daniel J Griffiths <ghost1227@archlinux.us>
# Thanks to: # Thanks to:
# #
# Andrwe beta-testing and submitting the fix for the all # Andrwe beta-testing and submitting the fix for the all
# important X incrementation function # important X incrementation function
# brisbin33 code cleanup # brisbin33 code cleanup
# tigrmesh finding a critical issue with the gnome-session handler # tigrmesh finding a critical issue with the gnome-session handler
# Profjim several incredibly useful patches # Profjim several incredibly useful patches
# lambchops468 consolekit and hibernation patches # lambchops468 consolekit and hibernation patches
# CasperVector Massive rearchitecturing and code sanitation # CasperVector Massive rearchitecturing and code sanitation
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -46,8 +46,8 @@ yesno()
eval value=\$${1} eval value=\$${1}


case "$value" in case "$value" in
[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) return 0;; [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) return 0;;
[Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0) return 1;; [Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0) return 1;;
*) warn "Invalid value for \`$1'; falling back to \`no' for now.";; *) warn "Invalid value for \`$1'; falling back to \`no' for now.";;
esac esac
} }
Expand Down Expand Up @@ -132,40 +132,40 @@ case ${flaglist[$binindex]} in
[Xx]) [Xx])
clear clear


# If X is already running and locktty=yes, activate it # If X is already running and locktty=yes, activate it
if $(yesno locktty); then if $(yesno locktty); then
if xdpyinfo -display ":$display.0" &> /dev/null; then if xdpyinfo -display ":$display.0" &> /dev/null; then
chvt "$((display+xtty))" chvt "$((display+xtty))"
exitnormal exitnormal
fi fi
fi fi


# Get the first empty display. # Get the first empty display.
display=0 display=0
while ((display < 7)); do while ((display < 7)); do
if dpyinfo=$(xdpyinfo -display ":$display.0" 2>&1 1>/dev/null) || if dpyinfo=$(xdpyinfo -display ":$display.0" 2>&1 1>/dev/null) ||
# Display is in use by another user. # Display is in use by another user.
[[ "$dpyinfo" == 'No protocol specified'* ]] || [[ "$dpyinfo" == 'No protocol specified'* ]] ||
# Invalid MIT cookie. # Invalid MIT cookie.
[[ "$dpyinfo" == 'Invalid MIT'* ]] [[ "$dpyinfo" == 'Invalid MIT'* ]]
then then
let display+=1 let display+=1
else else
break break
fi fi
done done


# run X in current tty # run X in current tty
if [[ $xtty == "keep" ]]; then if [[ $xtty == "keep" ]]; then
vt=$(tty) vt=$(tty)
vt=${vt#/dev/} vt=${vt#/dev/}
if [[ $vt != tty* ]]; then if [[ $vt != tty* ]]; then
error "error: invalid TTY" error "error: invalid TTY"
exiterror exiterror
fi fi
vt=${vt#tty} vt=${vt#tty}
else else
vt=$((xtty+display)) vt=$((xtty+display))
fi fi


serverargs=":${display} $serverargs vt$vt" serverargs=":${display} $serverargs vt$vt"
Expand All @@ -185,3 +185,4 @@ case ${flaglist[$binindex]} in
;; ;;
esac esac


# vim:set ts=4 sw=4 noet:
40 changes: 21 additions & 19 deletions src/cdm-xlaunch
Expand Up @@ -5,13 +5,13 @@
# Copyright (C) 2009-2011, Daniel J Griffiths <ghost1227@archlinux.us> # Copyright (C) 2009-2011, Daniel J Griffiths <ghost1227@archlinux.us>
# Thanks to: # Thanks to:
# #
# Andrwe beta-testing and submitting the fix for the all # Andrwe beta-testing and submitting the fix for the all
# important X incrementation function # important X incrementation function
# brisbin33 code cleanup # brisbin33 code cleanup
# tigrmesh finding a critical issue with the gnome-session handler # tigrmesh finding a critical issue with the gnome-session handler
# Profjim several incredibly useful patches # Profjim several incredibly useful patches
# lambchops468 consolekit and hibernation patches # lambchops468 consolekit and hibernation patches
# CasperVector Massive rearchitecturing and code sanisation # CasperVector Massive rearchitecturing and code sanisation
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -82,16 +82,18 @@ nohup startx $* > /dev/null 2>&1 &
# If wait(1) returns with a value >128, it was interrupted by kill(1), # If wait(1) returns with a value >128, it was interrupted by kill(1),
# so registration was sucessful. # so registration was sucessful.
if $consolekit; then if $consolekit; then
if [[ -n "$clockpid" ]]; then if [[ -n "$clockpid" ]]; then
if wait "$clockpid" >& /dev/null if wait "$clockpid" >& /dev/null
then then
kill "$dbuspid" kill "$dbuspid"
error "ConsoleKit registration timed out." error "ConsoleKit registration timed out."
exit 1 exit 1
else else
kill "$dbuspid" kill "$dbuspid"
info "ConsoleKit registration succeeded." info "ConsoleKit registration succeeded."
exit 0 exit 0
fi fi
fi fi
fi fi

# vim:set ts=4 sw=4 noet:

0 comments on commit 5ec919f

Please sign in to comment.