From f04340dfac53d6fa1335fa0ecfbe8f024111e457 Mon Sep 17 00:00:00 2001 From: clarkzjw Date: Fri, 18 Nov 2022 14:09:34 -0800 Subject: i3: bind F9 to switch between screen layouts --- dot_config/i3/config | 8 +- dot_config/rofi/monitor.rasi | 112 +++++++++++++++++++++ dot_gitconfig | 1 + .../private_executable_builtin-only.sh | 2 + dot_screenlayout/private_executable_monitor.sh | 2 - 5 files changed, 121 insertions(+), 4 deletions(-) create mode 100644 dot_config/rofi/monitor.rasi create mode 100644 dot_screenlayout/private_executable_builtin-only.sh delete mode 100644 dot_screenlayout/private_executable_monitor.sh diff --git a/dot_config/i3/config b/dot_config/i3/config index 5fa0715..ef94027 100644 --- a/dot_config/i3/config +++ b/dot_config/i3/config @@ -187,6 +187,10 @@ bindsym F1 exec ~/.config/i3/scripts/keyhint-2 # keybinding list in editor: # bindsym $mod+F1 exec xed ~/.config/i3/keybindings +# switch between builtin monitor and external monitors +bindsym F9 exec --no-startup-id ~/.config/i3/scripts/monitor + + # Backlight control bindsym XF86MonBrightnessUp exec --no-startup-id xbacklight +5 && notify-send "Brightness - $(xbacklight -get | cut -d '.' -f 1)%" bindsym XF86MonBrightnessDown exec --no-startup-id xbacklight -5 && notify-send "Brightness - $(xbacklight -get | cut -d '.' -f 1)%" @@ -360,7 +364,7 @@ exec --no-startup-id dex --autostart --environment i3 # start a script to setup displays # uncomment the next line, use arandr to setup displays and save the file as monitor: -exec --no-startup-id ~/.screenlayout/monitor.sh +exec --no-startup-id ~/.screenlayout/builtin-only.sh # set wallpaper exec --no-startup-id nitrogen --restore @@ -526,7 +530,7 @@ bar { # Application menu handled by rofi: # ##################################### -## rofi bindings fancy application menu ($mod+d /F9 optional disabled) +## rofi bindings fancy application menu bindsym $mod+d exec rofi -modi drun -show drun \ -config ~/.config/rofi/rofidmenu.rasi diff --git a/dot_config/rofi/monitor.rasi b/dot_config/rofi/monitor.rasi new file mode 100644 index 0000000..08d3f4e --- /dev/null +++ b/dot_config/rofi/monitor.rasi @@ -0,0 +1,112 @@ +configuration { + font: "Noto Sans Regular 20"; + show-icons: false; + icon-theme: "Qogir"; + scroll-method: 0; + disable-history: false; + sidebar-mode: false; +} + +@import "~/.config/rofi/arc_dark_transparent_colors.rasi" + +window { + background-color: @background; + border: 0; + padding: 10; + transparency: "real"; + width: 200px; + location: center; + /*y-offset: 18;*/ + /*x-offset: 850;*/ +} +listview { + lines: 3; + columns: 1; + scrollbar: false; +} +element { + border: 0; + padding: 1px; +} +element-text { + background-color: inherit; + text-color: inherit; +} +element.normal.normal { + background-color: @normal-background; + text-color: @normal-foreground; +} +element.normal.urgent { + background-color: @urgent-background; + text-color: @urgent-foreground; +} +element.normal.active { + background-color: @active-background; + text-color: @active-foreground; +} +element.selected.normal { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +} +element.selected.urgent { + background-color: @selected-urgent-background; + text-color: @selected-urgent-foreground; +} +element.selected.active { + background-color: @selected-active-background; + text-color: @selected-active-foreground; +} +element.alternate.normal { + background-color: @alternate-normal-background; + text-color: @alternate-normal-foreground; +} +element.alternate.urgent { + background-color: @alternate-urgent-background; + text-color: @alternate-urgent-foreground; +} +element.alternate.active { + background-color: @alternate-active-background; + text-color: @alternate-active-foreground; +} +scrollbar { + width: 4px; + border: 0; + handle-color: @normal-foreground; + handle-width: 8px; + padding: 0; +} +mode-switcher { + border: 2px 0px 0px; + border-color: @separatorcolor; +} +button { + spacing: 0; + text-color: @normal-foreground; +} +button.selected { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +} +case-indicator { + spacing: 0; + text-color: @normal-foreground; +} +entry { + spacing: 0; + text-color: @normal-foreground; +} +prompt { + spacing: 0; + text-color: @normal-foreground; +} +inputbar { + enabled: false; + children: [ case-indicator ]; +} +textbox-prompt-colon { + expand: false; + str: ":"; + margin: 0px 0.3em 0em 0em; + text-color: @normal-foreground; +} + diff --git a/dot_gitconfig b/dot_gitconfig index 27315b2..0a3fad2 100644 --- a/dot_gitconfig +++ b/dot_gitconfig @@ -1,5 +1,6 @@ [user] name = clarkzjw email = i@jinwei.me + signingkey = DD3B254076A2E156! [init] defaultBranch = master diff --git a/dot_screenlayout/private_executable_builtin-only.sh b/dot_screenlayout/private_executable_builtin-only.sh new file mode 100644 index 0000000..c7940ce --- /dev/null +++ b/dot_screenlayout/private_executable_builtin-only.sh @@ -0,0 +1,2 @@ +#!/bin/sh +xrandr --output eDP-1 --primary --mode 2256x1504 --pos 0x0 --rotate normal --output DP-1 --off --output DP-2 --off --output DP-3 --off --output DP-4 --off diff --git a/dot_screenlayout/private_executable_monitor.sh b/dot_screenlayout/private_executable_monitor.sh deleted file mode 100644 index c7940ce..0000000 --- a/dot_screenlayout/private_executable_monitor.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -xrandr --output eDP-1 --primary --mode 2256x1504 --pos 0x0 --rotate normal --output DP-1 --off --output DP-2 --off --output DP-3 --off --output DP-4 --off -- cgit v1.2.3