Various changes.

This commit is contained in:
2014-08-17 23:34:02 +02:00
parent 135b5449d3
commit 46c9c6de47
8 changed files with 91 additions and 62 deletions

View File

@@ -174,17 +174,19 @@
# regenerate and reload the configuration file
# if genconfig gets any paramters, it will invoke i3-msg reload
bindsym $mod+$reload exec --no-startup-id bash ~/.i3/scripts/genconfig.bash 1
bindsym $mod+$reload exec --no-startup-id ~/.i3/scripts/genconfig.bash 1
bindsym $mod+$restart restart
bindsym $mod+$exit exit
### START APPLICATIONS #####################################################
bindsym $mod+d exec j4-dmenu-desktop --dmenu="dmenu -b -i -l 10 -p '>' -nb '#222222' -nf '#ffffff' -sb '#e16b40' -sf '#000000'"
bindsym $mod+d exec j4-dmenu-desktop --dmenu="dmenu -fn 'DejaVu Sans Mono:size=11' -b -i -l 10 -p '>' -nb '#222222' -nf '#ffffff' -sb '#e16b40' -sf '#000000'"
bindsym $mod+Return exec $terminal
bindsym $mod+F1 exec firefox
bindsym Pause exec --no-startup-id ~/.i3/scripts/shutdown-menu.bash
################################################################################
### MODES ######################################################################
################################################################################
@@ -214,23 +216,6 @@
}
bindsym $mod+r mode "resize"
# Enabling a mode to shutdown, reboot, lock screen and so on
set $mode_system System (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown
mode "$mode_system" {
bindsym $key_lock exec --no-startup-id $path_i3exit $signal_lock, mode "default"
bindsym $key_logout exec --no-startup-id $path_i3exit $signal_logout, mode "default"
bindsym $key_suspend exec --no-startup-id $path_i3exit $signal_suspend, mode "default"
bindsym $key_hibernate exec --no-startup-id $path_i3exit $signal_hibernate, mode "default"
bindsym $key_reboot exec --no-startup-id $path_i3exit $signal_reboot, mode "default"
bindsym $key_shutdown exec --no-startup-id $path_i3exit $signal_shutdown, mode "default"
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+Pause mode "$mode_system"
bindsym Pause exec --no-startup-id $path_i3exit lock
################################################################################
### GENERAL SETUP ##############################################################
################################################################################
@@ -321,6 +306,7 @@ client.urgent #2f343a #900000 #ffffff #900000
for_window [class="^main\.py$" ] floating enable
for_window [class="^Xfce4-panel$"] floating enable
for_window [class="^Thunderbird"] border none
for_window [instance="^shutdown-menu$"] border normal
assign [class="^Thunderbird"] $workspace9
assign [class="^Skype$"] $workspace10

View File

Before

Width:  |  Height:  |  Size: 327 KiB

After

Width:  |  Height:  |  Size: 327 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 MiB

After

Width:  |  Height:  |  Size: 1.2 MiB

View File

@@ -12,6 +12,7 @@ touch "$LOGFILE"
log()
{
echo "$1"
echo "[$(date +%FT%T)] $1" >> "$LOGFILE"
}
@@ -19,24 +20,30 @@ lock()
{
resolution=$(xrandr | grep '*' | awk '{ print $1 }' | head -n1)
log "[I] Resolution found: \"$resolution\""
lockscreen="$HOME/.i3/data/lockscreen_$resolution.png"
lockscreen="$HOME/.i3/data/lockscreen/$resolution.png"
log "[I] Looking for lockscreen at \"$lockscreen\""
if [[ -f "$lockscreen" ]] ; then
log "[I] Lockscreen found, will be used as background image."
background_options="--image $lockscreen -t"
else
log "[W] Lockscreen not found, using color #$FALLBACK_COLOR as background."
log "[W] Lockscreen not found, using color #$FALLBACK_COLOR as background."
background_options="--color $FALLBACK_COLOR"
fi
i3lock $background_options #-p win --image "$HOME/pictures/windows-lockscreen.jpg"
retval=$?
[[ -z "$1" ]] && sleep 1 && xset dpms force off
[[ -z "$1" ]] && sleep 3 && xset dpms force off
return $retval
}
log "[I] Received signal \"$1\"."
if [[ "$1" == '-' ]]; then
read signal
else
signal="$1"
fi
case "$1" in
log "[I] Received signal \"$signal\"."
case "$signal" in
lock)
log "[I] Locking session."
lock
@@ -64,7 +71,7 @@ case "$1" in
;;
*)
echo "Usage: $0 {lock|logout|suspend|hibernate|reboot|shutdown}"
log "[E] Signal \"$1\" unknown. Aborting."
log "[E] Signal \"$signal\" unknown. Aborting."
exit 2
esac

View File

@@ -0,0 +1,18 @@
#!/usr/bin/env bash
options=(
"lock"
"logout"
"suspend"
"hibernate"
"reboot"
"shutdown")
i=1
output=$(
for option in "${options[@]}"; do
echo "($i) $option"
(( i++ ))
done | dmenu -fn 'DejaVu Sans Mono:size=11' -b -i -l 10 -p '>' -nb '#222222' -nf '#ffffff' -sb '#e16b40' -sf '#000000' -w 200 -name 'shutdown-menu')
[[ "$output" ]] && "$(dirname "$0")"/i3exit.bash "${output#(*) }"