diff --git a/.gitmodules b/.gitmodules index 9f6ee48..2ed931d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -8,3 +8,6 @@ [submodule "prezto"] path = zsh/.zprezto url = https://github.com/sorin-ionescu/prezto.git +[submodule "i3/.config/i3/i3blocks-contrib"] + path = i3/.config/i3/i3blocks-contrib + url = https://github.com/vivien/i3blocks-contrib.git diff --git a/i3/.config/i3/config b/i3/.config/i3/config index d532249..f4294d6 100644 --- a/i3/.config/i3/config +++ b/i3/.config/i3/config @@ -34,7 +34,7 @@ bindsym Control+Mod1+g exec --no-startup-id gvim bindsym Control+Mod1+e exec --no-startup-id myemacs -c bindsym $mod+Tab exec --no-startup-id winmenu.sh bindsym Mod1+Tab exec --no-startup-id winmenu.sh -bindsym $mod+p [class="Nemo"] scratchpad show +bindsym $mod+p [class="Nemo|Thunar|Ranger"] scratchpad show bindsym $mod+period [instance="emacs" title="^(?!myagenda$)"] scratchpad show bindsym $mod+shift+comma exec --no-startup-id myemacs -nc --eval '(progn (find-file "~/Dropbox/Todo/org/rules.org") (org-agenda-list) (set-frame-name "myagenda"))' bindsym $mod+c exec myemacs -n -e '(make-capture-frame)' @@ -66,11 +66,12 @@ bindsym $mod+o exec --no-startup-id filemenu $HOME # Arandr magic bindsym Mod1+F5 exec --no-startup-id monitors single -bindsym Mod1+F6 exec --no-startup-id monitors single HDMI -bindsym Mod1+F7 exec --no-startup-id monitors dual mirror -bindsym Mod1+F8 exec --no-startup-id monitors dual home +bindsym Mod1+F6 exec --no-startup-id monitors single-hdmi +bindsym Mod1+F7 exec --no-startup-id monitors dual-mirror +bindsym Mod1+F8 exec --no-startup-id monitors dual-home bindsym Mod1+F9 exec --no-startup-id monitors dual bindsym Mod1+F10 exec --no-startup-id xrandr --auto +bindsym Mod1+F11 exec --no-startup-id monitors # auto # Move to displays bindsym $mod+Mod1+j move workspace to output down @@ -262,7 +263,7 @@ for_window [class="^termite"] border 1px for_window [class="^lxterminal"] border 1px for_window [class="^xfce4-terminal"] border 1px for_window [title="^scratch"] move to scratchpad -for_window [class="^Nemo" title="Home"] move to scratchpad; +for_window [class="^Nemo|Thunar|Ranger"] move to scratchpad; #KDE for_window [class="Plasma-desktop"] border none for_window [class="krunner"] border none @@ -314,7 +315,7 @@ exec --no-startup-id nm-applet exec --no-startup-id pasystray exec --no-startup-id syndaemon -i 0.5 -d exec --no-startup-id i3-sensible-terminal --title=scratch -e 'tmux attach' -exec --no-startup-id xautolock -time 10 -corners "----" -locker 'i3lock -t -c 000000 -i ~/Images/Wallpapers/wallpaper.png' +exec --no-startup-id i3-exit.sh autolock exec --no-startup-id xfce4-power-manager exec --no-startup-id xfsettingsd --sm-client-disable & exec --no-startup-id clipit -n diff --git a/i3/.config/i3/i3blocks-contrib b/i3/.config/i3/i3blocks-contrib new file mode 160000 index 0000000..343f881 --- /dev/null +++ b/i3/.config/i3/i3blocks-contrib @@ -0,0 +1 @@ +Subproject commit 343f881878327d7071c170139de79085d9247a66 diff --git a/i3/.config/i3/i3blocks.conf b/i3/.config/i3/i3blocks.conf index b24c972..ff1c317 100644 --- a/i3/.config/i3/i3blocks.conf +++ b/i3/.config/i3/i3blocks.conf @@ -60,12 +60,6 @@ separator=true interval=30 instance=MemFree: -[memory] -label=MemTotal -separator=true -interval=30 -instance=MemTotal: - #[memory] #label=SWAP #instance=swap diff --git a/i3/.config/i3/status.sh b/i3/.config/i3/status.sh index b0f2a66..183ad1e 100755 --- a/i3/.config/i3/status.sh +++ b/i3/.config/i3/status.sh @@ -3,4 +3,4 @@ SCRIPT_DIR=/usr/lib/i3blocks if [ ! -d "$SCRIPT_DIR" ]; then SCRIPT_DIR=/usr/share/i3blocks fi -SCRIPT_DIR=$SCRIPT_DIR i3blocks -c $HOME/.config/i3/i3blocks.conf +CONTRIB_PATH=$HOME/.config/i3/i3blocks-contrib SCRIPT_DIR=$SCRIPT_DIR i3blocks -c $HOME/.config/i3/i3blocks.conf diff --git a/screenlayouts/.screenlayout/dual-home.sh b/screenlayouts/.screenlayout/dual-home.sh new file mode 100644 index 0000000..b26b7c1 --- /dev/null +++ b/screenlayouts/.screenlayout/dual-home.sh @@ -0,0 +1,2 @@ +#!/bin/sh +xrandr --output DP1 --off --output VIRTUAL1 --off --output eDP1 --mode 1920x1080 --pos 0x1080 --rotate normal --output HDMI1 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output VGA1 --off diff --git a/screenlayouts/.screenlayout/dual-mirror.sh b/screenlayouts/.screenlayout/dual-mirror.sh new file mode 100644 index 0000000..9bd63e9 --- /dev/null +++ b/screenlayouts/.screenlayout/dual-mirror.sh @@ -0,0 +1,2 @@ +#!/bin/sh +xrandr --output DP1 --off --output VIRTUAL1 --off --output eDP1 --mode 1920x1080 --rotate normal --output HDMI1 --primary --mode 1920x1080 --same-as eDP1 --output VGA1 --off diff --git a/screenlayouts/.screenlayout/dual.sh b/screenlayouts/.screenlayout/dual.sh new file mode 100644 index 0000000..188c59a --- /dev/null +++ b/screenlayouts/.screenlayout/dual.sh @@ -0,0 +1,3 @@ +#!/bin/sh +xrandr --output VIRTUAL1 --off --output DP1 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output HDMI1 --off --output eDP1 --mode 1920x1080 --pos 1920x0 --rotate normal --output VGA1 --off +xrandr --output "DVI-1-0" --off diff --git a/screenlayouts/.screenlayout/hdmi.sh b/screenlayouts/.screenlayout/hdmi.sh new file mode 100644 index 0000000..a098c7a --- /dev/null +++ b/screenlayouts/.screenlayout/hdmi.sh @@ -0,0 +1,2 @@ +#!/bin/sh +xrandr --output eDP1 --off --output DVI-1 --off --output DP1 --off --output HDMI1 --mode 1920x1080 --pos 0x0 --rotate normal --output VGA1 --off diff --git a/screenlayouts/.screenlayout/single.sh b/screenlayouts/.screenlayout/single.sh new file mode 100644 index 0000000..7d56dfa --- /dev/null +++ b/screenlayouts/.screenlayout/single.sh @@ -0,0 +1,2 @@ +#!/bin/sh +xrandr --output HDMI1 --off --output DVI-1 --off --output DP1 --off --output eDP1 --mode 1920x1080 --pos 0x0 --rotate normal --output VGA1 --off diff --git a/screenlayouts/.screenlayout/threescreens.sh b/screenlayouts/.screenlayout/threescreens.sh new file mode 100755 index 0000000..c55e26f --- /dev/null +++ b/screenlayouts/.screenlayout/threescreens.sh @@ -0,0 +1,2 @@ +#!/bin/sh +xrandr --output VIRTUAL1 --off --output eDP1 --primary --mode 1920x1080 --pos 1080x1080 --rotate normal --output DP1 --off --output HDMI2 --off --output HDMI1 --mode 1920x1080 --pos 0x0 --rotate left --output DP2 --mode 2560x1080 --pos 1080x0 --rotate normal diff --git a/scripts/.bin/i3-exit.sh b/scripts/.bin/i3-exit.sh index 9c5292e..7716c66 100755 --- a/scripts/.bin/i3-exit.sh +++ b/scripts/.bin/i3-exit.sh @@ -1,6 +1,14 @@ #!/bin/bash case "$1" in + locknow) + scrot /tmp/screen.png + convert /tmp/screen.png -scale 10% -scale 1000% /tmp/screen.png + i3lock -e -i /tmp/screen.png + ;; + autolock) + xautolock -time 10 -corners "----" -locker "$0 locknow" + ;; lock) xautolock -locknow ;; diff --git a/scripts/.bin/monitors b/scripts/.bin/monitors index b1882b1..a643514 100755 --- a/scripts/.bin/monitors +++ b/scripts/.bin/monitors @@ -1,34 +1,9 @@ #!/bin/sh -case $1 in - "single") - case $2 in - "HDMI") - ~/.screenlayout/gsi-single.sh - xrandr --output eDP1 --off --output DVI-1 --off --output DP1 --off --output HDMI1 --mode 1920x1080 --pos 0x0 --rotate normal --output VGA1 --off - ;; - *) - #xrandr --auto --output eDP1 --primary --output DP1 --off - ~/.screenlayout/gsi-single.sh - xrandr --output HDMI1 --off --output DVI-1 --off --output DP1 --off --output eDP1 --mode 1920x1080 --pos 0x0 --rotate normal --output VGA1 --off - ;; - esac - ;; - "dual") - case $2 in - "mirror") - xrandr --output DP1 --off --output VIRTUAL1 --off --output eDP1 --mode 1920x1080 --rotate normal --output HDMI1 --primary --mode 1920x1080 --same-as eDP1 --output VGA1 --off - ;; - "home") - xrandr --output DP1 --off --output VIRTUAL1 --off --output eDP1 --mode 1920x1080 --pos 0x1080 --rotate normal --output HDMI1 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output VGA1 --off - ;; - *) - #xrandr --auto --output eDP1 --primary --right-of DP1 - xrandr --output VIRTUAL1 --off --output DP1 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output HDMI1 --off --output eDP1 --mode 1920x1080 --pos 1920x0 --rotate normal --output VGA1 --off - xrandr --output "DVI-1-0" --off - ;; - esac - ;; -esac +if [ "$#" -lt 1 ]; then + ls -1 ~/.screenlayout | rofi -dmenu | xargs -I '{}' sh "$HOME/.screenlayout/{}" || exit +else + sh $HOME/.screenlayout/$1.sh +fi if [ `command -v nitrogen` ]; then nitrogen --restore fi