From 694e8bffe3a9a349f4633b1a0d59065c23ce2b96 Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Thu, 6 Jul 2017 21:53:33 +0200 Subject: [PATCH 1/2] New way of handling screens Still not handled in workspace affectation though. --- config/i3/autorandrdefaultmenu | 10 +++++ config/i3/autorandrloadmenu | 10 +++++ config/i3/autorandrremovemenu | 10 +++++ config/i3/autorandrsavemenu | 10 +++++ config/i3/config | 78 ++++++---------------------------- config/polybar/config | 52 +++++++++++++---------- config/polybar/launch.sh | 10 ++++- scripts/install-prefs | 4 +- 8 files changed, 93 insertions(+), 91 deletions(-) create mode 100755 config/i3/autorandrdefaultmenu create mode 100755 config/i3/autorandrloadmenu create mode 100755 config/i3/autorandrremovemenu create mode 100755 config/i3/autorandrsavemenu diff --git a/config/i3/autorandrdefaultmenu b/config/i3/autorandrdefaultmenu new file mode 100755 index 0000000..3f8a36e --- /dev/null +++ b/config/i3/autorandrdefaultmenu @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +shopt -s nullglob globstar + +profile=$(echo -e "$(autorandr 2>&1 | cut -d' ' -f1)" | ~/.config/i3/dmenu_cmd -p "Default profile" "$@") + +[[ -n $profile ]] || exit + +autorandr --default "$profile" + diff --git a/config/i3/autorandrloadmenu b/config/i3/autorandrloadmenu new file mode 100755 index 0000000..930b044 --- /dev/null +++ b/config/i3/autorandrloadmenu @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +shopt -s nullglob globstar + +profile=$(echo -e "common\nhorizontal\nvertical\n$(autorandr 2>&1 | cut -d' ' -f1)" | ~/.config/i3/dmenu_cmd -p "Load profile" "$@") + +[[ -n $profile ]] || exit + +autorandr --load "$profile" + diff --git a/config/i3/autorandrremovemenu b/config/i3/autorandrremovemenu new file mode 100755 index 0000000..7b12673 --- /dev/null +++ b/config/i3/autorandrremovemenu @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +shopt -s nullglob globstar + +profile=$(echo -e "$(autorandr 2>&1 | cut -d' ' -f1)" | ~/.config/i3/dmenu_cmd -p "Remove profile" "$@") + +[[ -n $profile ]] || exit + +autorandr --remove "$profile" + diff --git a/config/i3/autorandrsavemenu b/config/i3/autorandrsavemenu new file mode 100755 index 0000000..bae7989 --- /dev/null +++ b/config/i3/autorandrsavemenu @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +shopt -s nullglob globstar + +profile=$(echo -e "$(autorandr 2>&1 | cut -d' ' -f1)" | ~/.config/i3/dmenu_cmd -p "Save profile" "$@") + +[[ -n $profile ]] || exit + +autorandr --save "$profile" + diff --git a/config/i3/config b/config/i3/config index 5d07b70..98e9070 100644 --- a/config/i3/config +++ b/config/i3/config @@ -39,7 +39,7 @@ bindsym $mod+F2 exec --no-startup-id ~/.config/i3/dmenu_run bindsym Mod1+F2 exec --no-startup-id ~/.config/i3/dmenu_run bindsym $mod+c exec --no-startup-id ~/.config/i3/passmenu -bindsym $mod+x exec --no-startup-id ~/.config/i3/clipmenu +#bindsym $mod+x exec --no-startup-id ~/.config/i3/clipmenu bindsym $mod+asterisk exec --no-startup-id ~/.config/i3/sshmenu bindsym $mod+dollar exec --no-startup-id ~/.config/i3/sshmenu root @@ -302,47 +302,21 @@ mode "Resize" { bindsym $mod+r mode "Resize" -set $background exec --no-startup-id feh --bg-fill $HOME/.config/i3/bg.jpg -bindsym $mod+Shift+a $background -set $mode_screen_select [V] VGA1 [H] HDMI1 -mode "$mode_screen_select" { - bindsym v mode "$mode_screen_VGA1" - bindsym h mode "$mode_screen_HDMI1" - - # back to normal: Enter or Escape - bindsym Return mode "default" - bindsym Escape mode "default" -} -bindsym $mod+t mode "$mode_screen_select" - -set $mode_screen_VGA1 VGA [R] Right [L] Left [U] Up [D] Down [C] Copy [O] Off -mode "$mode_screen_VGA1" { - bindsym r exec xrandr --output VGA1 --auto --right-of LVDS1; $background - bindsym l exec xrandr --output VGA1 --auto --left-of LVDS1; $background - bindsym u exec xrandr --output VGA1 --auto --above LVDS1; $background - bindsym d exec xrandr --output VGA1 --auto --below LVDS1; $background - bindsym c exec xrandr --output VGA1 --auto --same-as LVDS1; $background - bindsym o exec xrandr --output VGA1 --auto --off; $background - - # back to normal: Enter or Escape - bindsym Return mode "default" - bindsym Escape mode "default" -} - -set $mode_screen_HDMI1 HDMI [R] Right [L] Left [U] Up [D] Down [C] Copy [O] Off -mode "$mode_screen_HDMI1" { - bindsym r exec xrandr --output HDMI1 --auto --right-of LVDS1; $background - bindsym l exec xrandr --output HDMI1 --auto --left-of LVDS1; $background - bindsym u exec xrandr --output HDMI1 --auto --above LVDS1; $background - bindsym d exec xrandr --output HDMI1 --auto --below LVDS1; $background - bindsym c exec xrandr --output HDMI1 --auto --same-as LVDS1; $background - bindsym o exec xrandr --output HDMI1 --auto --off; $background +set $mode_screen Screen setup [A] Auto [L] Load [S] Save [R] Remove [D] Default +bindsym $mod+t mode "$mode_screen" +mode "$mode_screen" { + bindsym a exec autorandr --change --force, mode "default" + bindsym l exec ~/.config/i3/autorandrloadmenu, mode "default" + bindsym s exec ~/.config/i3/autorandrsavemenu, mode "default" + bindsym r exec ~/.config/i3/autorandrremovemenu, mode "default" + bindsym d exec ~/.config/i3/autorandrdefaultmenu, mode "default" # back to normal: Enter or Escape bindsym Return mode "default" bindsym Escape mode "default" } +# Screen temperature ("redness") setting bindsym $mod+y mode "$mode_temp" set $mode_temp Temperature [R] Red [D] Dust storm [C] Campfire [O] Normal [A] All nighter [B] Blue mode "$mode_temp" { @@ -378,26 +352,6 @@ set $13 #ae82ff set $14 #66efd5 set $15 #cfd0c2 -# Start i3bar to display a workspace bar (plus the system information i3status if available) -bar { - i3bar_command ~/.config/polybar/launch.sh - #mode hide - #status_command ~/c.sh -# wheel_up_cmd nop -# wheel_down_cmd nop - font pango:DejaVu Sans Mono 9 - font pango:Sans 8 - colors { - separator $08 - background $00 - statusline $fg - focused_workspace $02 $02 $bg - active_workspace $00 $03 $08 - inactive_workspace $00 $08 $fg - urgent_workspace $00 $01 $fg - } -} - # Inactivity settings exec --no-startup-id xautolock -time 10 -locker 'xset dpms force standby' -killtime 1 -killer '$locker' bindsym $mod+F4 exec --no-startup-id xautolock -disable @@ -405,25 +359,17 @@ bindsym $mod+F5 exec --no-startup-id xautolock -enable # Autostart applications -$background +exec --no-startup-id autorandr --change # Screen configuration and everything that depends on it exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 # Password remembering exec --no-startup-id gnome-keyring-daemon # Password remembering exec --no-startup-id numlockx on # Activate Num lock #exec --no-startup-id nm-applet # Network manager tray icon #exec --no-startup-id compton -b # Compositing manager -#exec --no-startup-id conky -c $HOME/.conky/status # Desktop widget exec --no-startup-id unclutter # Hide mouse cursor after some time exec --no-startup-id dunst # Notifications -exec --no-startup-id $HOME/.config/i3/clipmenud # Clipboard manager +#exec --no-startup-id $HOME/.config/i3/clipmenud # Clipboard manager exec --no-startup-id mpd # Music Player Daemon -# Autostart programs -#exec --no-startup-id i3-msg 'workspace $WS8; exec firefox --new-window tweetdeck.twitter.com' -#exec --no-startup-id i3-msg 'workspace $WS9; exec firefox --new-window rss.frogeye.fr' -#exec --no-startup-id clementine -#exec --no-startup-id evolution -#exec --no-startup-id pidgin - set $ignore #ff00000 # Theme colors diff --git a/config/polybar/config b/config/polybar/config index 309d4dd..27502f1 100644 --- a/config/polybar/config +++ b/config/polybar/config @@ -31,14 +31,10 @@ whiteF = #cfd0c2 background = ${theme.blackB} foreground = ${theme.foreground} -[bar/example] -;separator = | -monitor = ${env:MONITOR:LVDS1} +[bar/base] +monitor = ${env:display:LVDS1} width = 100% height = 20 -;offset-x = 1% -;offset-y = 1% -;radius = 6.0 fixed-center = false background = ${colors.background} @@ -60,12 +56,6 @@ font-1 = "DejaVu Sans:size=10;0" font-2 = "DejaVu Sans Mono for Powerline:pixelsize=10;0" modules-left = i3 -modules-center = mpd -modules-right = cpu memory temperature eth wlan filesystem xbacklight volume battery date - -tray-position = right -tray-padding = 2 -tray-transparent = false ;wm-restack = bspwm wm-restack = i3 @@ -82,6 +72,21 @@ bottom = true enable-ipc = true +[bar/primary] +inherit = bar/base + +modules-right = cpu memory temperature eth wlan xbacklight volume battery date + +tray-position = right +tray-padding = 2 +tray-transparent = false + +[bar/secondary] +inherit = bar/base +modules-center = mpd +modules-right = ethMore wlanMore filesystem xbacklight volume date + + [module/filesystem] type = internal/fs interval = 25 @@ -148,7 +153,7 @@ format-paused = ${self.format-online} format-stopped = label-song =  %title% - %artist% -label-song-maxlen = 25 +label-song-maxlen = 35 label-song-ellipsis = true label-time = %elapsed%/%total% @@ -172,7 +177,7 @@ toggle-off-foreground = #55 [module/xbacklight] type = internal/xbacklight -output = LVDS1 +output = ${env:display:LVDS1} enable-scroll = true format = ramp-0 = 🌕 @@ -213,19 +218,21 @@ interface = eth0 interval = 1 format-connected =  -;label-connected = %local_ip% (↑%upspeed% ↓%downspeed%) label-connected = %local_ip% format-connected-foreground = ${theme.blueF} format-disconnected = +[module/ethMore] +inherit = module/eth +label-connected = ↑%upspeed% ↓%downspeed% + [module/wlan] type = internal/network interface = wlan0 interval = 1 format-connected =  -;label-connected = %local_ip% %essid% (↑%upspeed% ↓%downspeed%) label-connected = %local_ip% %essid% format-connected-foreground = ${theme.cyanF} @@ -244,15 +251,16 @@ animation-packetloss-0 =  animation-packetloss-1 =  animation-packetloss-framerate = 500 +[module/wlanMore] +inherit = module/wlan +label-connected = ↑%upspeed% ↓%downspeed% + [module/date] type = internal/date interval = 1 -date = -date-alt = " %d/%m/%Y" - -time =  %H:%M -time-alt =  %H:%M:%S +date = " %d/%m/%Y" +time =  %H:%M:%S format =