├── .gitignore ├── .gitmodules ├── LICENSE ├── README.md ├── Xresources ├── compton.conf ├── config ├── i3-default-config-backup ├── i3-lock-screen.png ├── i3-manjaro-default-config-backup ├── i3blocks.conf ├── i3status.conf ├── libinput-gestures.conf ├── myrmidon-tasks.json └── utils ├── brightness_decrease.sh ├── brightness_gui.sh ├── brightness_increase.sh ├── connect_external_monitor.py ├── date_with_tz.sh ├── disconnect_external_monitor.py ├── gsls_script ├── map_touchscreen_to_laptop_screen.sh ├── to_grayscale.sh ├── touchpad_toggle.sh ├── volume_decrease.sh ├── volume_increase.sh ├── volume_mute.sh └── xrandr-dmenu-zsh.sh /.gitignore: -------------------------------------------------------------------------------- 1 | i3-project-focus-workflow/node_modules/* 2 | .Rproj.user 3 | *.Rproj -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "i3-wm-multi-disp-scripts"] 2 | path = i3_wm_multi_disp_scripts 3 | url = git@github.com:sainathadapa/i3-project-focus-workflow.git 4 | [submodule "i3blocks-contrib"] 5 | path = i3blocks-contrib 6 | url = git@github.com:vivien/i3blocks-contrib.git 7 | [submodule "myrmidon"] 8 | path = myrmidon 9 | url = https://github.com/moustacheful/myrmidon.git 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This repo contains my custom configuration for [I3 tiling window manager](https://i3wm.org/). 2 | 3 | Notes: 4 | - $mod key is Mod4 (Windows key on most keyboards) 5 | - A project is a set of workspaces with the format - `(workspace-number)::(project-name):(somenumber)`. Read more at [i3-wm-multi-disp-scripts](https://github.com/sainathadapa/i3-wm-multi-disp-scripts). 6 | - [py3status](https://py3status.readthedocs.io/en/latest/intro.html) and [rofi](https://github.com/DaveDavenport/rofi) are the main dependencies. 7 | 8 | Instructions: 9 | - Backup your i3 config! 10 | - git clone --recursive git@github.com:sainathadapa/i3-wm-config.git ~/.i3 11 | - Install all the dependencies 12 | - Done! 13 | 14 | Shortcuts: 15 | 16 | | Key | Purpose | 17 | | --- | ------- | 18 | | $mod + (1-9,0) | Switch to workspaces with number 1-10 | 19 | | $mod + Shift + (1-9,0) | Move the container to the workspaces with number 1-10 | 20 | | $mod + h (j, k, l) | focus left (down, up, right) window | 21 | | $mod + Shift + h (j, k, l) | move focused window left (down, up, right) | 22 | | $mod + Return | terminal | 23 | | $mod + Shift + r | Restart I3 inplace | 24 | | $mod + r | Activate resize mode | 25 | | $mod + space | Change focus between tiling and floating windows | 26 | | $mod + Shift + space | Toggle floating status of the focused container | 27 | | $mod + a | Focus parent container | 28 | | $mod + d | Focus child container | 29 | | $mod + e | Toggle the layout of the focused container | 30 | | $mod + t | Split the current container horizontally | 31 | | $mod + y | Split the current container vertically | 32 | | $mod + f | Fullscreen mode for the focused container | 33 | | $mod + q | Lock the system | 34 | | $mod + z | Show scratchpad | 35 | | $mod + Shift + z | Move container to scratchpad | 36 | | $mod + x | Toggle borders | 37 | | $mod + s | Toggle touchpad | 38 | | $mod + u | Create a floating video with explicit size, ideal for watching videos | 39 | | Print | Screenshot of the whole screen | 40 | | $mod + Print | Select an area to screenshot | 41 | | $mod + minus | Log-out, shutdown, etc menu | 42 | | F4 | Kill the focused window | 43 | | F7 | Rofi GUI to open a program | 44 | | F8 | Opens a GUI for selecting a window, and the moves the selected window to the current workspace | 45 | | F12 | Rofi GUI to switch to a window | 46 | | $mod + Shift + p | Start a new project | 47 | | $mod + p | Switch to the next project | 48 | | $mod + o | Rename current project | 49 | | $mod + Tab | Focus the workspace on the next monitor of the current project | 50 | | $mod + Control + Tab | Move the focused container to the next workspace of the current project | 51 | | $mod + Shift + Tab | Shift all the workspaces of the current project to their next monitors respectively | 52 | -------------------------------------------------------------------------------- /Xresources: -------------------------------------------------------------------------------- 1 | Xft.dpi: 96 2 | Xft.antialias: true 3 | Xft.hinting: true 4 | Xft.rgba: rgb 5 | Xft.autohint: false 6 | Xft.hintstyle: hintslight 7 | Xft.lcdfilter: lcddefault 8 | 9 | ! ROFI Color theme 10 | ! ------------------------------------------------------------------------------ 11 | ! rofi.color-enabled: true 12 | ! rofi.color-window: #393939, #393939, #268bd2 13 | ! rofi.color-normal: #393939, #ffffff, #393939, #268bd2, #ffffff 14 | ! rofi.color-active: #393939, #268bd2, #393939, #268bd2, #205171 15 | ! rofi.color-urgent: #393939, #f3843d, #393939, #268bd2, #ffc39c 16 | 17 | rofi.color-enabled: true 18 | rofi.color-window: #1e1e20, #dc7f41, #dc7f41 19 | rofi.color-normal: #1e1e20, #c5c8c6, #1e1e20, #1e1e20, #dc7f41 20 | rofi.color-active: #1e1e20, #c5c8c6, #1e1e20, #1e1e20, #dc7f41 21 | rofi.color-urgent: #1e1e20, #c5c8c6, #1e1e20, #1e1e20, #dc7f41 22 | 23 | rofi.separator-style: solid 24 | rofi.sidebar-mode: false 25 | rofi.lines: 5 26 | rofi.font: Source Code Pro Semibold 10.5 27 | rofi.bw: 1 28 | rofi.columns: 2 29 | rofi.padding: 5 30 | rofi.fixed-num-lines: true 31 | rofi.hide-scrollbar: true 32 | ! ------------------------------------------------------------------------------ 33 | 34 | *background: #1e1e20 35 | *foreground: #c5c8c6 36 | *cursorColor: #c5c8c6 37 | *color0: #1e1e20 38 | *color1: #e6a57a 39 | *color2: #e39866 40 | *color3: #df8b54 41 | *color4: #dc7f41 42 | *color5: #85678f 43 | *color6: #b06534 44 | *color7: #f1cbb3 45 | *color8: #f4d8c6 46 | *color9: #e6a57a 47 | *color10: #e39866 48 | *color11: #df8b54 49 | *color12: #dc7f41 50 | *color13: #c6723a 51 | *color14: #b06534 52 | *color15: #E8E8E8 53 | 54 | Xcursor.theme: xcursor-breeze 55 | Xcursor.size: 0 56 | 57 | ! from https://www.reddit.com/r/archlinux/comments/5gntxy/urxvt_source_code_pro_font_looks_bad/ 58 | URxvt*font: xft:Source Code Pro:size=12:antialias=true:hinting=true 59 | URxvt*boldFont: xft:Source Code Pro:size=12:antialias=true:hinting=true 60 | URxvt*italicFont: xft:Source Code Pro:style=Oblique:size=12:antialias=true:hinting=true 61 | URxvt*boldItalicFont: xft:Source Code Pro:style=Bold Oblique:size=12:antialias=true:hinting=true 62 | 63 | ! URxvt.font: 9x15,xft:TerminessTTFNerdFontMono 64 | ! alternative font settings with 'terminus': 65 | ! URxvt.font: -xos4-terminus-medium-r-normal--16-160-72-72-c-80-iso10646-1 66 | ! URxvt.bold.font: -xos4-terminus-bold-r-normal--16-160-72-72-c-80-iso10646-1 67 | !! terminus names see end of file! 68 | 69 | URxvt.depth: 32 70 | URxvt.background: [100]#222D31 71 | URxvt*scrollBar: false 72 | URxvt*mouseWheelScrollPage: false 73 | URxvt*cursorBlink: true 74 | URxvt*background: black 75 | URxvt*foreground: grey 76 | URxvt*saveLines: 10000 77 | 78 | ! for 'fake' transparency (without Compton) uncomment the following three lines 79 | ! URxvt*inheritPixmap: true 80 | ! URxvt*transparent: true 81 | ! URxvt*shading: 138 82 | 83 | ! Normal copy-paste keybindings without perls 84 | URxvt.iso14755: false 85 | URxvt.keysym.Shift-Control-V: eval:paste_clipboard 86 | URxvt.keysym.Shift-Control-C: eval:selection_to_clipboard 87 | !Xterm escape codes, word by word movement 88 | URxvt.keysym.Control-Left: \033[1;5D 89 | URxvt.keysym.Shift-Control-Left: \033[1;6D 90 | URxvt.keysym.Control-Right: \033[1;5C 91 | URxvt.keysym.Shift-Control-Right: \033[1;6C 92 | URxvt.keysym.Control-Up: \033[1;5A 93 | URxvt.keysym.Shift-Control-Up: \033[1;6A 94 | URxvt.keysym.Control-Down: \033[1;5B 95 | URxvt.keysym.Shift-Control-Down: \033[1;6B 96 | ! Rxvt.perl-ext-common: ...,clipboard 97 | ! URxvt.keysym.M-C-c: perl:clipboard:copy 98 | ! URxvt.keysym.M-v: perl:clipboard:paste 99 | ! URxvt.keysym.M-C-v: perl:clipboard:paste_escaped 100 | ! URxvt*termName: string 101 | ! URxvt*geometry: geometry 102 | ! URxvt*chdir: string 103 | ! URxvt*loginShell: boolean 104 | ! URxvt*multiClickTime: number 105 | ! URxvt*jumpScroll: boolean 106 | ! URxvt*skipScroll: boolean 107 | ! URxvt*pastableTabs: boolean 108 | ! URxvt*scrollstyle: plain 109 | ! URxvt*scrollBar_right: boolean 110 | ! URxvt*scrollBar_floating: true 111 | ! URxvt*scrollBar_align: mode 112 | ! URxvt*thickness: number 113 | ! URxvt*scrollTtyOutput: boolean 114 | URxvt*scrollTtyKeypress: true 115 | URxvt*scrollWithBuffer: true 116 | ! URxvt*tintColor: !7DA55 117 | ! URxvt*blurRadius: HxV 118 | ! URxvt*fading: number 119 | ! URxvt*fadeColor: color 120 | ! URxvt*utmpInhibit: boolean 121 | ! URxvt*urgentOnBell: boolean 122 | ! URxvt*visualBell: boolean 123 | ! URxvt*mapAlert: boolean 124 | ! URxvt*meta8: boolean 125 | ! URxvt*tripleclickwords: boolean 126 | ! URxvt*insecure: boolean 127 | ! URxvt*cursorUnderline: boolean 128 | ! URxvt*pointerBlank: boolean 129 | ! URxvt*color0: color 130 | ! URxvt*color1: color 131 | ! URxvt*color2: color 132 | ! URxvt*color3: color 133 | ! URxvt*color4: color 134 | ! URxvt*color5: color 135 | ! URxvt*color6: color 136 | ! URxvt*color7: color 137 | ! URxvt*color8: color 138 | ! URxvt*color9: color 139 | ! URxvt*color10: color 140 | ! URxvt*color11: color 141 | ! URxvt*color12: color 142 | ! URxvt*color13: color 143 | ! URxvt*color14: color 144 | ! URxvt*color15: color 145 | ! URxvt*colorBD: color 146 | ! URxvt*colorIT: color 147 | ! URxvt*colorUL: color 148 | ! URxvt*colorRV: color 149 | ! URxvt*underlineColor: color 150 | ! URxvt*scrollColor: color 151 | ! URxvt*troughColor: color 152 | ! URxvt*highlightColor: color 153 | ! URxvt*highlightTextColor: color 154 | ! URxvt*cursorColor: color 155 | ! URxvt*cursorColor2: color 156 | ! URxvt*pointerColor: color 157 | ! URxvt*pointerColor2: color 158 | ! URxvt*borderColor: color 159 | ! URxvt*iconFile: file 160 | ! URxvt*font: fontname 161 | ! URxvt*boldFont: fontname 162 | ! URxvt*italicFont: fontname 163 | ! URxvt*boldItalicFont: fontname 164 | ! URxvt*intensityStyles: boolean 165 | ! URxvt*inputMethod: name 166 | ! URxvt*preeditType: style 167 | ! URxvt*imLocale: string 168 | ! URxvt*imFont: fontname 169 | ! URxvt*title: string 170 | ! URxvt*iconName: string 171 | ! URxvt*buffered: boolean 172 | ! URxvt*depth: number 173 | ! URxvt*visual: number 174 | ! URxvt*transient-for: windowid 175 | ! URxvt*override-redirect: boolean 176 | ! URxvt*hold: boolean 177 | ! URxvt*externalBorder: number 178 | ! URxvt*internalBorder: number 179 | ! URxvt*borderLess: true 180 | ! URxvt*lineSpace: number 181 | ! URxvt*letterSpace: number 182 | ! URxvt*skipBuiltinGlyphs: boolean 183 | ! URxvt*pointerBlankDelay: number 184 | ! URxvt*backspacekey: string 185 | ! URxvt*deletekey: string 186 | ! URxvt*print-pipe: string 187 | ! URxvt*modifier: modifier 188 | ! URxvt*cutchars: string 189 | ! URxvt*answerbackString: string 190 | ! URxvt*secondaryScreen: boolean 191 | ! URxvt*secondaryScroll: boolean 192 | ! URxvt*perl-lib: string 193 | ! URxvt*perl-eval: perl-eval 194 | URxvt*perl-ext: default,url-select 195 | URxvt.perl-ext-common: default 196 | URxvt.url-launcher: /usr/bin/xdg-open 197 | URxvt.url-select.launcher: /usr/bin/xdg-open 198 | URxvt.url-select.underline: true 199 | URxvt.matcher.button: 1 200 | ! URxvt*iso14755: boolean 201 | ! URxvt*iso14755_52: boolean 202 | ! URxvt*xrm: string 203 | ! URxvt*keysym.sym: keysym 204 | ! URxvt*background.border: boolean 205 | ! URxvt*background.expr: string 206 | ! URxvt*background.interval: seconds 207 | ! URxvt*bell-command: string 208 | ! URxvt*kuake.hotkey: string 209 | ! URxvt*matcher.button: string 210 | ! URxvt*matcher.launcher: string 211 | ! URxvt*matcher.launcher.*: string 212 | ! URxvt*matcher.pattern.*: string 213 | ! URxvt*matcher.rend.*: string 214 | ! URxvt*remote-clipboard.fetch: string 215 | ! URxvt*remote-clipboard.store: string 216 | ! URxvt*searchable-scrollback: string 217 | ! URxvt*selection-autotransform.*: string 218 | ! URxvt*selection-pastebin.cmd: string 219 | ! URxvt*selection-pastebin.url: string 220 | ! URxvt*selection.pattern-0: string 221 | ! URxvt*tab-bg: colour 222 | ! URxvt*tab-fg: colour 223 | ! URxvt*tabbar-bg: colour 224 | ! URxvt*tabbar-fg: colour 225 | ! URxvt*url-launcher: string 226 | 227 | ! The Terminus font uses the following X-names: 228 | ! -xos4-terminus-medium-r-normal--12-120-72-72-c-60-iso10646-1 229 | ! -xos4-terminus-medium-r-normal--14-140-72-72-c-80-iso10646-1 230 | ! -xos4-terminus-medium-r-normal--16-160-72-72-c-80-iso10646-1 231 | ! -xos4-terminus-medium-r-normal--20-200-72-72-c-100-iso10646-1 232 | ! -xos4-terminus-medium-r-normal--22-220-72-72-c-110-iso10646-1 233 | ! -xos4-terminus-medium-r-normal--24-240-72-72-c-120-iso10646-1 234 | ! -xos4-terminus-medium-r-normal--28-280-72-72-c-140-iso10646-1 235 | ! -xos4-terminus-medium-r-normal--32-320-72-72-c-160-iso10646-1 236 | ! -xos4-terminus-bold-r-normal--12-120-72-72-c-60-iso10646-1 237 | ! -xos4-terminus-bold-r-normal--14-140-72-72-c-80-iso10646-1 238 | ! -xos4-terminus-bold-r-normal--16-160-72-72-c-80-iso10646-1 239 | ! -xos4-terminus-bold-r-normal--20-200-72-72-c-100-iso10646-1 240 | ! -xos4-terminus-bold-r-normal--24-240-72-72-c-120-iso10646-1 241 | ! -xos4-terminus-bold-r-normal--28-280-72-72-c-140-iso10646-1 242 | ! -xos4-terminus-bold-r-normal--32-320-72-72-c-160-iso10646-1 243 | -------------------------------------------------------------------------------- /compton.conf: -------------------------------------------------------------------------------- 1 | # Shadow 2 | shadow = true; 3 | # no-dnd-shadow = true; 4 | no-dock-shadow = true; 5 | clear-shadow = true; 6 | detect-rounded-corners = true; 7 | shadow-radius = 5; 8 | shadow-offset-x = 1; 9 | shadow-offset-y = 1; 10 | shadow-opacity = .3; 11 | shadow-ignore-shaped = false; 12 | shadow-exclude = [ 13 | "name = 'Notification'", 14 | # workaround for conky until it provides window properties: 15 | "override_redirect = 1 && !WM_CLASS@:s", 16 | "class_g ?= 'Dmenu'", 17 | # "class_g ?= 'Dunst'", 18 | # disable shadows for hidden windows: 19 | "_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'", 20 | "_GTK_FRAME_EXTENTS@:c", 21 | # disables shadows on sticky windows: 22 | # "_NET_WM_STATE@:32a *= '_NET_WM_STATE_STICKY'", 23 | # disables shadows on i3 frames 24 | "class_g ?= 'i3-frame'" 25 | ]; 26 | 27 | # shadow-exclude-reg = "x10+0+0"; 28 | # xinerama-shadow-crop = true; 29 | 30 | menu-opacity = 0.95; 31 | inactive-opacity = 1; 32 | #active-opacity = 1; 33 | #alpha-step = 0.01; 34 | #inactive-dim = 0.0; 35 | #blur-background = false; 36 | #blur-kern = "3x3box"; 37 | 38 | fading = false; 39 | fade-delta = 1; 40 | fade-in-step = 0.03; 41 | fade-out-step = 0.03; 42 | fade-exclude = [ ]; 43 | 44 | backend = "xrender"; 45 | mark-wmwin-focused = true; 46 | mark-ovredir-focused = true; 47 | detect-client-opacity = true; 48 | unredir-if-possible = true; 49 | refresh-rate = 0; 50 | vsync = "none"; 51 | dbe = false; 52 | paint-on-overlay = true; 53 | focus-exclude = [ "class_g = 'Cairo-clock'" ]; 54 | detect-transient = true; 55 | detect-client-leader = true; 56 | invert-color-include = [ ]; 57 | glx-copy-from-front = false; 58 | glx-swap-method = "undefined"; 59 | 60 | opacity-rule = [ 61 | "99:name *?= 'Call'", 62 | "99:class_g = 'Chromium'", 63 | "99:name *?= 'Conky'", 64 | "99:class_g = 'Darktable'", 65 | "50:class_g = 'Dmenu'", 66 | "99:name *?= 'Event'", 67 | "99:class_g = 'Firefox'", 68 | "99:class_g = 'GIMP'", 69 | "99:name *?= 'Image'", 70 | "99:class_g = 'Lazpaint'", 71 | "99:class_g = 'Midori'", 72 | "99:name *?= 'Minitube'", 73 | "99:class_g = 'Mousepad'", 74 | "99:name *?= 'MuseScore'", 75 | "90:name *?= 'Page Info'", 76 | "99:name *?= 'Pale Moon'", 77 | "90:name *?= 'Panel'", 78 | "99:class_g = 'Pinta'", 79 | "90:name *?= 'Restart'", 80 | "99:name *?= 'sudo'", 81 | "99:name *?= 'Screenshot'", 82 | "99:class_g = 'Viewnior'", 83 | "99:class_g = 'VirtualBox'", 84 | "99:name *?= 'VLC'", 85 | "99:name *?= 'Write'", 86 | "93:class_g = 'URxvt' && !_NET_WM_STATE@:32a", 87 | "0:_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'", 88 | "96:_NET_WM_STATE@:32a *= '_NET_WM_STATE_STICKY'" 89 | ]; 90 | 91 | wintypes : 92 | { 93 | tooltip : 94 | { 95 | fade = true; 96 | shadow = false; 97 | opacity = 0.85; 98 | focus = true; 99 | }; 100 | fullscreen : 101 | { 102 | fade = true; 103 | shadow = false; 104 | opacity = 1; 105 | focus = true; 106 | }; 107 | }; 108 | -------------------------------------------------------------------------------- /config: -------------------------------------------------------------------------------- 1 | # i3 config file (v4) 2 | # Please see http://i3wm.org/docs/userguide.html for a complete reference! 3 | 4 | # Set mod key (Mod1=, Mod4=) 5 | set $mod Mod4 6 | 7 | # Set key folder paths 8 | set $i3path ~/.i3 9 | set $i3multipath ~/.i3/i3_wm_multi_disp_scripts 10 | 11 | # set default desktop layout (default is tiling) 12 | workspace_layout stacked 13 | 14 | # Configure border style 15 | new_window pixel 1 16 | new_float normal 17 | 18 | # Hides vertical and horizontal borders when there's only one window. 19 | hide_edge_borders none 20 | 21 | # Font for window titles. Will also be used by the bar unless a different font 22 | # is used in the bar {} block below. 23 | # font xft:URWGothic-Book 11 24 | font pango: Source Code Pro 10 25 | 26 | # Use Mouse+$mod to drag floating windows 27 | floating_modifier $mod 28 | 29 | # https://i3wm.org/docs/userguide.html#_focus_wrapping 30 | force_focus_wrapping yes 31 | 32 | # Assume you are on workspace "1: www" and switch to "2: IM" using mod+2 33 | # because somebody sent you a message. You don’t need to remember 34 | # where you came from now, you can just press $mod+2 again to switch back to "1: www". 35 | workspace_auto_back_and_forth yes 36 | 37 | # turn on mouse following 38 | focus_follows_mouse yes 39 | 40 | # start a terminal 41 | bindsym $mod+Return exec terminal 42 | 43 | # screenshots 44 | bindsym Print exec --no-startup-id i3-scrot 45 | bindsym $mod+Print --release exec --no-startup-id i3-scrot -s 46 | 47 | # kill focused window 48 | bindsym F4 kill 49 | 50 | ################################################################################################ 51 | ## sound-section - DO NOT EDIT if you wish to automatically upgrade Alsa -> Pulseaudio later! ## 52 | ################################################################################################ 53 | 54 | exec --no-startup-id volumeicon 55 | # bindsym $mod+Ctrl+m exec terminal -e 'alsamixer' 56 | #exec --no-startup-id pulseaudio 57 | #exec --no-startup-id pa-applet 58 | #bindsym $mod+Ctrl+m exec pavucontrol 59 | 60 | ################################################################################################ 61 | 62 | 63 | # move focused window 64 | bindsym $mod+Shift+h move left 65 | bindsym $mod+Shift+j move down 66 | bindsym $mod+Shift+k move up 67 | bindsym $mod+Shift+l move right 68 | 69 | 70 | # Set shut down, restart and locking features 71 | bindsym $mod+minus mode "$mode_system" 72 | set $mode_system (l)ock, (e)xit, switch_(u)ser, (s)uspend, (h)ibernate, (r)eboot, (Shift+s)hutdown 73 | mode "$mode_system" { 74 | bindsym l exec --no-startup-id i3exit lock, mode "default" 75 | bindsym s exec --no-startup-id i3exit suspend, mode "default" 76 | bindsym u exec --no-startup-id i3exit switch_user, mode "default" 77 | bindsym e exec --no-startup-id i3exit logout, mode "default" 78 | bindsym h exec --no-startup-id i3exit hibernate, mode "default" 79 | bindsym r exec --no-startup-id i3exit reboot, mode "default" 80 | bindsym Shift+s exec --no-startup-id i3exit shutdown, mode "default" 81 | 82 | # exit system mode: "Enter" or "Escape" 83 | bindsym Return mode "default" 84 | bindsym Escape mode "default" 85 | } 86 | 87 | # resize window (you can also use the mouse for that) 88 | mode "resize" { 89 | # back to normal: Enter or Escape 90 | bindsym Return mode "default" 91 | bindsym Escape mode "default" 92 | 93 | bindsym Left resize shrink width 5 px or 5 ppt 94 | bindsym Down resize shrink height 5 px or 5 ppt 95 | bindsym Up resize grow height 5 px or 5 ppt 96 | bindsym Right resize grow width 5 px or 5 ppt 97 | 98 | bindsym h resize shrink width 1 px or 1 ppt 99 | bindsym j resize shrink height 1 px or 1 ppt 100 | bindsym k resize grow height 1 px or 1 ppt 101 | bindsym l resize grow width 1 px or 1 ppt 102 | } 103 | 104 | # focus the parent container 105 | bindsym $mod+a focus parent 106 | # focus the child container 107 | bindsym $mod+d focus child 108 | # change container layout 109 | bindsym $mod+e layout toggle all 110 | # enter fullscreen mode for the focused container 111 | bindsym $mod+f fullscreen 112 | # change focus 113 | bindsym $mod+h focus left 114 | bindsym $mod+j focus down 115 | bindsym $mod+k focus up 116 | bindsym $mod+l focus right 117 | # split in horizontal orientation 118 | bindsym $mod+t split h;exec notify-send 'tile horizontally' 119 | # Resize mode 120 | bindsym $mod+r mode "resize" 121 | # toggle touchpad 122 | bindsym $mod+s exec $i3path/utils/touchpad_toggle.sh 123 | # small window for videos 124 | bindsym $mod+u fullscreen disable; floating enable; resize set 800 450; sticky enable; move position 870 25 125 | # split in vertical orientation 126 | bindsym $mod+y split v;exec notify-send 'tile vertically' 127 | # Toggle border 128 | bindsym $mod+x border toggle 129 | # Show the first scratchpad window 130 | bindsym $mod+z scratchpad show 131 | # Lock the system 132 | bindsym $mod+q exec i3lock -i $i3path/i3-lock-screen.png -t -f 133 | # bindsym $mod+q exec --no-startup-id blurlock 134 | 135 | # toggle tiling / floating 136 | bindsym $mod+Shift+space floating toggle 137 | 138 | # change focus between tiling / floating windows 139 | bindsym $mod+space focus mode_toggle 140 | 141 | # switch to workspace 142 | bindsym $mod+KP_1 workspace number 1 143 | bindsym $mod+KP_2 workspace number 2 144 | bindsym $mod+KP_3 workspace number 3 145 | bindsym $mod+KP_4 workspace number 4 146 | bindsym $mod+KP_5 workspace number 5 147 | bindsym $mod+KP_6 workspace number 6 148 | bindsym $mod+KP_7 workspace number 7 149 | bindsym $mod+KP_8 workspace number 8 150 | bindsym $mod+KP_9 workspace number 9 151 | bindsym $mod+KP_0 workspace number 0 152 | bindsym $mod+1 workspace number 1 153 | bindsym $mod+2 workspace number 2 154 | bindsym $mod+3 workspace number 3 155 | bindsym $mod+4 workspace number 4 156 | bindsym $mod+5 workspace number 5 157 | bindsym $mod+6 workspace number 6 158 | bindsym $mod+7 workspace number 7 159 | bindsym $mod+8 workspace number 8 160 | bindsym $mod+9 workspace number 9 161 | bindsym $mod+0 workspace number 0 162 | 163 | # move focused container to workspace 164 | bindsym $mod+Shift+KP_1 move container to workspace number 1 165 | bindsym $mod+Shift+KP_2 move container to workspace number 2 166 | bindsym $mod+Shift+KP_3 move container to workspace number 3 167 | bindsym $mod+Shift+KP_4 move container to workspace number 4 168 | bindsym $mod+Shift+KP_5 move container to workspace number 5 169 | bindsym $mod+Shift+KP_6 move container to workspace number 6 170 | bindsym $mod+Shift+KP_7 move container to workspace number 7 171 | bindsym $mod+Shift+KP_8 move container to workspace number 8 172 | bindsym $mod+Shift+KP_9 move container to workspace number 8 173 | bindsym $mod+Shift+KP_0 move container to workspace number 8 174 | bindsym $mod+Shift+1 move container to workspace number 1 175 | bindsym $mod+Shift+2 move container to workspace number 2 176 | bindsym $mod+Shift+3 move container to workspace number 3 177 | bindsym $mod+Shift+4 move container to workspace number 4 178 | bindsym $mod+Shift+5 move container to workspace number 5 179 | bindsym $mod+Shift+6 move container to workspace number 6 180 | bindsym $mod+Shift+7 move container to workspace number 7 181 | bindsym $mod+Shift+8 move container to workspace number 8 182 | bindsym $mod+Shift+9 move container to workspace number 9 183 | bindsym $mod+Shift+0 move container to workspace number 0 184 | 185 | # restart i3 inplace (preserves your layout/session, can be used to upgrade i3) 186 | bindsym $mod+Shift+r restart 187 | 188 | # exit i3 (logs you out of your X session) 189 | # bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'" 190 | 191 | mode "mouse" { 192 | # set your three speeds here 193 | 194 | set $slow 1 195 | set $quick 10 196 | set $fast 50 197 | 198 | # Mouse movement (slow/fine-tuned) -- vim keybindings 199 | 200 | bindsym h exec xdotool mousemove_relative -- -$slow 0 201 | bindsym j exec xdotool mousemove_relative 0 $slow 202 | bindsym k exec xdotool mousemove_relative -- 0 -$slow 203 | bindsym l exec xdotool mousemove_relative $slow 0 204 | 205 | # Mouse movement (slow/fine-tuned) -- arrow keys 206 | 207 | bindsym Left exec xdotool mousemove_relative -- -$slow 0 208 | bindsym Down exec xdotool mousemove_relative 0 $slow 209 | bindsym Up exec xdotool mousemove_relative -- 0 -$slow 210 | bindsym Right exec xdotool mousemove_relative $slow 0 211 | 212 | # Mouse movement (quicker) -- vim keybindings 213 | 214 | bindsym Shift+h exec xdotool mousemove_relative -- -$quick 0 215 | bindsym Shift+j exec xdotool mousemove_relative 0 $quick 216 | bindsym Shift+k exec xdotool mousemove_relative -- 0 -$quick 217 | bindsym Shift+l exec xdotool mousemove_relative $quick 0 218 | 219 | # Mouse movement (quicker) -- arrow keys 220 | 221 | bindsym Shift+Left exec xdotool mousemove_relative -- -$quick 0 222 | bindsym Shift+Down exec xdotool mousemove_relative 0 $quick 223 | bindsym Shift+Up exec xdotool mousemove_relative -- 0 -$quick 224 | bindsym Shift+Right exec xdotool mousemove_relative $quick 0 225 | 226 | # Mouse movement (fast) -- vim keybindings 227 | 228 | bindsym Shift+$mod2+h exec xdotool mousemove_relative -- -$fast 0 229 | bindsym Shift+$mod2+j exec xdotool mousemove_relative 0 $fast 230 | bindsym Shift+$mod2+k exec xdotool mousemove_relative -- 0 -$fast 231 | bindsym Shift+$mod2+l exec xdotool mousemove_relative $fast 0 232 | 233 | # Mouse movement (fast) -- arrow keys 234 | 235 | bindsym Shift+$mod2+Left exec xdotool mousemove_relative -- -$fast 0 236 | bindsym Shift+$mod2+Down exec xdotool mousemove_relative 0 $fast 237 | bindsym Shift+$mod2+Up exec xdotool mousemove_relative -- 0 -$fast 238 | bindsym Shift+$mod2+Right exec xdotool mousemove_relative $fast 0 239 | 240 | # Mouse movement (special down-right) 241 | 242 | bindsym m exec xdotool mousemove_relative 10 10 243 | 244 | # Left Click 245 | bindsym f exec xdotool click 1 246 | 247 | # Middle Click 248 | bindsym d exec xdotool click 2 249 | 250 | # Right Click 251 | bindsym s exec xdotool click 3 252 | 253 | # Left Click-and-drag 254 | bindsym Shift+f exec xdotool mousedown 1 255 | 256 | # Middle Click-and-drag 257 | bindsym Shift+d exec xdotool mousedown 2 258 | 259 | # Right Click-and-drag 260 | bindsym Shift+s exec xdotool mousedown 3 261 | 262 | # Left Drag release 263 | bindsym $mod2+f exec xdotool mouseup 1 264 | 265 | # Middle Drag release 266 | bindsym $mod2+d exec xdotool mouseup 2 267 | 268 | # Right Drag release 269 | bindsym $mod2+s exec xdotool mouseup 3 270 | 271 | 272 | # return to normal keybindings -- IMPORTANT!! 273 | 274 | bindsym Escape mode "default" 275 | } 276 | 277 | # this serves as the exhaustive collection of things one can do with workspaces 278 | mode "workspace" { 279 | bindsym Left workspace prev_on_output 280 | bindsym Right workspace next_on_ouput 281 | bindsym Down workspace prev 282 | bindsym Up workspace next 283 | 284 | bindsym Tab layout toggle all 285 | 286 | bindsym r exec i3-input -F 'rename workspace to "%s"' -P 'New name: ' 287 | 288 | bindsym ',' move workspace to output left 289 | bindsym '.' move workspace to output right 290 | 291 | # back to normal: Enter or Escape 292 | bindsym Return mode "default" 293 | bindsym Escape mode "default" 294 | } 295 | 296 | # hide/unhide i3status bar 297 | # bindsym $mod+m bar mode toggle 298 | 299 | # Make the currently focused window a scratchpad 300 | bindsym $mod+Shift+z move scratchpad 301 | 302 | # multi display workflow scripts 303 | bindsym $mod+Shift+p exec $i3multipath/.env/bin/python $i3multipath/create_new_project.py 304 | bindsym $mod+p exec $i3multipath/.env/bin/python $i3multipath/switch_to_next_project.py 305 | bindsym $mod+Shift+Tab exec $i3multipath/.env/bin/python $i3multipath/move_workspaces_in_project_to_next_output.py 306 | bindsym $mod+Control+Tab exec $i3multipath/.env/bin/python $i3multipath/move_current_container_to_next_workspace_in_project.py 307 | bindsym $mod+o exec $i3multipath/.env/bin/python $i3multipath/rename_project.py 308 | bindsym F8 exec $i3multipath/.env/bin/python $i3multipath/bring_container_to_current_workspace.py 309 | bindsym $mod+Tab exec $i3multipath/switcher.sh 310 | 311 | # rofi bindings 312 | bindsym F7 exec "rofi -show-icons -modi combi -show combi -combi-modi drun,run" 313 | bindsym F12 exec rofi -show-icons -show window 314 | 315 | # launch categorized menu 316 | # bindsym F10 exec --no-startup-id morc_menu 317 | 318 | # volume 319 | bindsym XF86AudioLowerVolume exec ~/.i3/utils/volume_decrease.sh 320 | bindsym XF86AudioRaiseVolume exec ~/.i3/utils/volume_increase.sh 321 | bindsym XF86AudioMute exec ~/.i3/utils/volume_mute.sh 322 | 323 | # music 324 | # bindsym XF86AudioPlay exec playerctl 'play-pause' 325 | # bindsym XF86AudioNext exec playerctl next 326 | # bindsym XF86AudioPrev exec playerctl previous 327 | 328 | # brightness 329 | bindsym XF86MonBrightnessDown exec $i3path/utils/brightness_decrease.sh 330 | bindsym XF86MonBrightnessUp exec $i3path/utils/brightness_increase.sh 331 | bindsym Shift+XF86MonBrightnessUp exec $i3path/utils/brightness_gui.sh 332 | bindsym Shift+XF86MonBrightnessDown exec $i3path/utils/brightness_gui.sh 333 | 334 | popup_during_fullscreen leave_fullscreen 335 | show_marks yes 336 | 337 | for_window [class="^.*"] border pixel 2 338 | 339 | # Disable floating for nemo windows 340 | for_window [class="Nemo" instance="^desktop_window$"] floating disable 341 | 342 | # chrome extension popups 343 | for_window [instance="^crx.*$" window_role="pop-up"] floating enable 344 | for_window [instance="^crx.*$" window_role="pop-up"] sticky enable 345 | 346 | # Open specific applications in floating mode 347 | for_window [title="alsamixer"] floating enable border pixel 1 348 | for_window [class="calamares"] floating enable border normal 349 | for_window [class="Clipgrab"] floating enable 350 | for_window [title="File Transfer*"] floating enable 351 | for_window [class="Galculator"] floating enable border pixel 1 352 | for_window [class="GParted"] floating enable border normal 353 | for_window [title="i3_help"] floating enable sticky enable border normal 354 | for_window [class="Lightdm-settings"] floating enable 355 | for_window [class="Lxappearance"] floating enable sticky enable border normal 356 | for_window [class="Manjaro-hello"] floating enable 357 | for_window [class="Manjaro Settings Manager"] floating enable border normal 358 | for_window [title="MuseScore: Play Panel"] floating enable 359 | for_window [class="Nitrogen"] floating enable sticky enable border normal 360 | for_window [class="Oblogout"] fullscreen enable 361 | for_window [class="octopi"] floating enable 362 | for_window [title="About Pale Moon"] floating enable 363 | #for_window [class="Pamac-manager"] floating enable 364 | for_window [class="Pavucontrol"] floating enable 365 | for_window [class="qt5ct"] floating enable sticky enable border normal 366 | for_window [class="Qtconfig-qt4"] floating enable sticky enable border normal 367 | for_window [class="Simple-scan"] floating enable border normal 368 | for_window [class="(?i)System-config-printer.py"] floating enable border normal 369 | for_window [class="Skype"] floating enable border normal 370 | for_window [class="Timeset-gui"] floating enable border normal 371 | for_window [class="(?i)virtualbox"] floating enable border normal 372 | for_window [class="Xfburn"] floating enable 373 | 374 | # Prepend title with program name 375 | for_window [class=".*"] title_format "%class - %title" 376 | 377 | # switch to workspace with urgent window automatically 378 | for_window [urgent=latest] focus 379 | 380 | # Start i3bar to display a workspace bar (plus the system information i3status 381 | # finds out, if available) 382 | bar { 383 | i3bar_command i3bar -t 384 | # status_command i3blocks -c $i3path/i3blocks.conf 385 | status_command py3status -c $i3path/i3status.conf 386 | tray_output primary 387 | 388 | position top 389 | colors { 390 | background #222222 391 | statusline #dddddd 392 | separator #666666 393 | 394 | # border backgr. text 395 | focused_workspace #0088CC #0088CC #ffffff #292F34 396 | active_workspace #333333 #333333 #ffffff #FDF6E3 397 | inactive_workspace #333333 #333333 #888888 #EEE8D5 398 | urgent_workspace #2f343a #900000 #ffffff #E5201D 399 | } 400 | } 401 | 402 | # Theme colors 403 | # class border backgr. text indic. child_border 404 | client.focused #0088CC #0088CC #ffffff #dddddd 405 | client.focused_inactive #333333 #333333 #888888 #292d2e 406 | client.unfocused #333333 #333333 #888888 #292d2e 407 | client.urgent #2f343a #900000 #ffffff #900000 408 | client.placeholder #000000 #0c0c0c #ffffff #000000 409 | client.background #2B2C2B 410 | 411 | ############################# 412 | ### settings for i3-gaps: ### 413 | ############################# 414 | 415 | # Set inner/outer gaps 416 | # gaps inner 5 417 | # gaps outer -2 418 | 419 | # Additionally, you can issue commands with the following syntax. This is useful to bind keys to changing the gap size. 420 | # gaps inner|outer current|all set|plus|minus 421 | # gaps inner all set 10 422 | # gaps outer all plus 5 423 | 424 | # Smart gaps (gaps used if only more than one container on the workspace) 425 | smart_gaps on 426 | 427 | # Smart borders (draw borders around container only if it is not the only container on this workspace) 428 | # on|no_gaps (on=always activate and no_gaps=only activate if the gap size to the edge of the screen is 0) 429 | smart_borders on 430 | 431 | # Press $mod+Shift+g to enter the gap mode. Choose o or i for modifying outer/inner gaps. Press one of + / - (in-/decrement for current workspace) or 0 (remove gaps for current workspace). If you also press Shift with these keys, the change will be global for all workspaces. 432 | set $mode_gaps Gaps: (o) outer, (i) inner 433 | set $mode_gaps_outer Outer Gaps: +|-|0 (local), Shift + +|-|0 (global) 434 | set $mode_gaps_inner Inner Gaps: +|-|0 (local), Shift + +|-|0 (global) 435 | # bindsym $mod+Shift+g mode "$mode_gaps" 436 | 437 | mode "$mode_gaps" { 438 | bindsym o mode "$mode_gaps_outer" 439 | bindsym i mode "$mode_gaps_inner" 440 | bindsym Return mode "default" 441 | bindsym Escape mode "default" 442 | } 443 | mode "$mode_gaps_inner" { 444 | bindsym plus gaps inner current plus 5 445 | bindsym minus gaps inner current minus 5 446 | bindsym 0 gaps inner current set 0 447 | 448 | bindsym Shift+plus gaps inner all plus 5 449 | bindsym Shift+minus gaps inner all minus 5 450 | bindsym Shift+0 gaps inner all set 0 451 | 452 | bindsym Return mode "default" 453 | bindsym Escape mode "default" 454 | } 455 | mode "$mode_gaps_outer" { 456 | bindsym plus gaps outer current plus 5 457 | bindsym minus gaps outer current minus 5 458 | bindsym 0 gaps outer current set 0 459 | 460 | bindsym Shift+plus gaps outer all plus 5 461 | bindsym Shift+minus gaps outer all minus 5 462 | bindsym Shift+0 gaps outer all set 0 463 | 464 | bindsym Return mode "default" 465 | bindsym Escape mode "default" 466 | } 467 | 468 | 469 | ############################# 470 | ## Autostart applications ### 471 | ############################# 472 | 473 | # create initial workspaces 474 | exec --no-startup-id $i3multipath/.env/bin/python $i3multipath/create_new_project.py main 475 | 476 | exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 477 | exec --no-startup-id nitrogen --restore ; sleep 1; compton -b 478 | exec --no-startup-id xfce4-power-manager 479 | exec --no-startup-id pamac-tray 480 | exec_always --no-startup-id fix_xcursor 481 | exec --no-startup-id nm-applet 482 | exec --no-startup-id dropbox start 483 | exec --no-startup-id insync start 484 | exec --no-startup-id hsetroot -solid "#222222" # set desktop background 485 | 486 | for_window [instance="dropdownTerminal"] floating enable 487 | for_window [instance="dropdownTerminal"] resize set 1500 900 488 | for_window [instance="dropdownTerminal"] border none 489 | for_window [instance="dropdownTerminal"] move position center 490 | for_window [instance="dropdownTerminal"] move scratchpad 491 | exec --no-startup-id urxvt -bg rgba:0000/0000/0000/c800 --depth 32 -pe tabbed -name dropdownTerminal 492 | 493 | -------------------------------------------------------------------------------- /i3-default-config-backup: -------------------------------------------------------------------------------- 1 | # This file has been auto-generated by i3-config-wizard(1). 2 | # It will not be overwritten, so edit it as you like. 3 | # 4 | # Should you change your keyboard layout some time, delete 5 | # this file and re-run i3-config-wizard(1). 6 | # 7 | 8 | # i3 config file (v4) 9 | # 10 | # Please see http://i3wm.org/docs/userguide.html for a complete reference! 11 | 12 | set $mod Mod4 13 | 14 | # Font for window titles. Will also be used by the bar unless a different font 15 | # is used in the bar {} block below. 16 | # This font is widely installed, provides lots of unicode glyphs, right-to-left 17 | # text rendering and scalability on retina/hidpi displays (thanks to pango). 18 | font pango:DejaVu Sans Mono 8 19 | # Before i3 v4.8, we used to recommend this one as the default: 20 | # font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1 21 | # The font above is very space-efficient, that is, it looks good, sharp and 22 | # clear in small sizes. However, its unicode glyph coverage is limited, the old 23 | # X core fonts rendering does not support right-to-left and this being a bitmap 24 | # font, it doesn’t scale on retina/hidpi displays. 25 | 26 | # Use Mouse+$mod to drag floating windows to their wanted position 27 | floating_modifier $mod 28 | 29 | # start a terminal 30 | bindsym $mod+Return exec i3-sensible-terminal 31 | 32 | # kill focused window 33 | bindsym $mod+Shift+q kill 34 | 35 | # start dmenu (a program launcher) 36 | bindsym $mod+d exec dmenu_run 37 | # There also is the (new) i3-dmenu-desktop which only displays applications 38 | # shipping a .desktop file. It is a wrapper around dmenu, so you need that 39 | # installed. 40 | # bindsym $mod+d exec --no-startup-id i3-dmenu-desktop 41 | 42 | # change focus 43 | bindsym $mod+j focus left 44 | bindsym $mod+k focus down 45 | bindsym $mod+l focus up 46 | bindsym $mod+semicolon focus right 47 | 48 | # alternatively, you can use the cursor keys: 49 | bindsym $mod+Left focus left 50 | bindsym $mod+Down focus down 51 | bindsym $mod+Up focus up 52 | bindsym $mod+Right focus right 53 | 54 | # move focused window 55 | bindsym $mod+Shift+j move left 56 | bindsym $mod+Shift+k move down 57 | bindsym $mod+Shift+l move up 58 | bindsym $mod+Shift+semicolon move right 59 | 60 | # alternatively, you can use the cursor keys: 61 | bindsym $mod+Shift+Left move left 62 | bindsym $mod+Shift+Down move down 63 | bindsym $mod+Shift+Up move up 64 | bindsym $mod+Shift+Right move right 65 | 66 | # split in horizontal orientation 67 | bindsym $mod+h split h 68 | 69 | # split in vertical orientation 70 | bindsym $mod+v split v 71 | 72 | # enter fullscreen mode for the focused container 73 | bindsym $mod+f fullscreen 74 | 75 | # change container layout (stacked, tabbed, toggle split) 76 | bindsym $mod+s layout stacking 77 | bindsym $mod+w layout tabbed 78 | bindsym $mod+e layout toggle split 79 | 80 | # toggle tiling / floating 81 | bindsym $mod+Shift+space floating toggle 82 | 83 | # change focus between tiling / floating windows 84 | bindsym $mod+space focus mode_toggle 85 | 86 | # focus the parent container 87 | bindsym $mod+a focus parent 88 | 89 | # focus the child container 90 | #bindsym $mod+d focus child 91 | 92 | # switch to workspace 93 | bindsym $mod+1 workspace 1 94 | bindsym $mod+2 workspace 2 95 | bindsym $mod+3 workspace 3 96 | bindsym $mod+4 workspace 4 97 | bindsym $mod+5 workspace 5 98 | bindsym $mod+6 workspace 6 99 | bindsym $mod+7 workspace 7 100 | bindsym $mod+8 workspace 8 101 | bindsym $mod+9 workspace 9 102 | bindsym $mod+0 workspace 10 103 | 104 | # move focused container to workspace 105 | bindsym $mod+Shift+1 move container to workspace 1 106 | bindsym $mod+Shift+2 move container to workspace 2 107 | bindsym $mod+Shift+3 move container to workspace 3 108 | bindsym $mod+Shift+4 move container to workspace 4 109 | bindsym $mod+Shift+5 move container to workspace 5 110 | bindsym $mod+Shift+6 move container to workspace 6 111 | bindsym $mod+Shift+7 move container to workspace 7 112 | bindsym $mod+Shift+8 move container to workspace 8 113 | bindsym $mod+Shift+9 move container to workspace 9 114 | bindsym $mod+Shift+0 move container to workspace 10 115 | 116 | # reload the configuration file 117 | bindsym $mod+Shift+c reload 118 | # restart i3 inplace (preserves your layout/session, can be used to upgrade i3) 119 | bindsym $mod+Shift+r restart 120 | # exit i3 (logs you out of your X session) 121 | bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'" 122 | 123 | # resize window (you can also use the mouse for that) 124 | mode "resize" { 125 | # These bindings trigger as soon as you enter the resize mode 126 | 127 | # Pressing left will shrink the window’s width. 128 | # Pressing right will grow the window’s width. 129 | # Pressing up will shrink the window’s height. 130 | # Pressing down will grow the window’s height. 131 | bindsym j resize shrink width 10 px or 10 ppt 132 | bindsym k resize grow height 10 px or 10 ppt 133 | bindsym l resize shrink height 10 px or 10 ppt 134 | bindsym semicolon resize grow width 10 px or 10 ppt 135 | 136 | # same bindings, but for the arrow keys 137 | bindsym Left resize shrink width 10 px or 10 ppt 138 | bindsym Down resize grow height 10 px or 10 ppt 139 | bindsym Up resize shrink height 10 px or 10 ppt 140 | bindsym Right resize grow width 10 px or 10 ppt 141 | 142 | # back to normal: Enter or Escape 143 | bindsym Return mode "default" 144 | bindsym Escape mode "default" 145 | } 146 | 147 | bindsym $mod+r mode "resize" 148 | 149 | # Start i3bar to display a workspace bar (plus the system information i3status 150 | # finds out, if available) 151 | bar { 152 | status_command i3status 153 | } 154 | -------------------------------------------------------------------------------- /i3-lock-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sainathadapa/i3-wm-config/ec01757e97572750bea49b45a31f3b5cb4ce1fd9/i3-lock-screen.png -------------------------------------------------------------------------------- /i3-manjaro-default-config-backup: -------------------------------------------------------------------------------- 1 | # i3 config file (v4) 2 | # Please see http://i3wm.org/docs/userguide.html for a complete reference! 3 | 4 | # Set mod key (Mod1=, Mod4=) 5 | set $mod Mod4 6 | 7 | # set default desktop layout (default is tiling) 8 | # workspace_layout tabbed 9 | 10 | # Configure border style 11 | new_window pixel 1 12 | new_float normal 13 | 14 | # Hide borders 15 | hide_edge_borders none 16 | 17 | # change borders 18 | bindsym $mod+u border none 19 | bindsym $mod+y border pixel 1 20 | bindsym $mod+n border normal 21 | 22 | # Font for window titles. Will also be used by the bar unless a different font 23 | # is used in the bar {} block below. 24 | font xft:URWGothic-Book 11 25 | 26 | # Use Mouse+$mod to drag floating windows 27 | floating_modifier $mod 28 | 29 | # start a terminal 30 | bindsym $mod+Return exec terminal 31 | 32 | # kill focused window 33 | bindsym $mod+Shift+q kill 34 | 35 | # start program launcher 36 | bindsym $mod+d exec --no-startup-id dmenu_recency 37 | 38 | # launch categorized menu 39 | bindsym $mod+z exec --no-startup-id morc_menu 40 | 41 | ################################################################################################ 42 | ## sound-section - DO NOT EDIT if you wish to automatically upgrade Alsa -> Pulseaudio later! ## 43 | ################################################################################################ 44 | 45 | exec --no-startup-id volumeicon 46 | bindsym $mod+Ctrl+m exec terminal -e 'alsamixer' 47 | #exec --no-startup-id pulseaudio 48 | #exec --no-startup-id pa-applet 49 | #bindsym $mod+Ctrl+m exec pavucontrol 50 | 51 | ################################################################################################ 52 | 53 | # Screen brightness controls 54 | # bindsym XF86MonBrightnessUp exec "xbacklight -inc 10; notify-send 'brightness up'" 55 | # bindsym XF86MonBrightnessDown exec "xbacklight -dec 10; notify-send 'brightness down'" 56 | 57 | # Start Applications 58 | bindsym $mod+Ctrl+b exec terminal -e 'bmenu' 59 | bindsym $mod+F2 exec palemoon 60 | bindsym $mod+F3 exec pcmanfm 61 | # bindsym $mod+F3 exec ranger 62 | bindsym $mod+Shift+F3 exec gksu pcmanfm 63 | bindsym $mod+F5 exec terminal -e 'mocp' 64 | bindsym $mod+t exec --no-startup-id pkill compton 65 | bindsym $mod+Ctrl+t exec --no-startup-id compton -b 66 | bindsym $mod+Shift+d --release exec "killall dunst; exec notify-send 'restart dunst'" 67 | bindsym Print exec --no-startup-id i3-scrot 68 | bindsym $mod+Print --release exec --no-startup-id i3-scrot -w 69 | bindsym $mod+Shift+Print --release exec --no-startup-id i3-scrot -s 70 | bindsym $mod+Shift+h exec xdg-open /usr/share/doc/manjaro/i3_help.pdf 71 | bindsym $mod+Ctrl+x --release exec --no-startup-id xkill 72 | 73 | # focus_follows_mouse no 74 | 75 | # change focus 76 | bindsym $mod+j focus left 77 | bindsym $mod+k focus down 78 | bindsym $mod+l focus up 79 | bindsym $mod+semicolon focus right 80 | 81 | # alternatively, you can use the cursor keys: 82 | bindsym $mod+Left focus left 83 | bindsym $mod+Down focus down 84 | bindsym $mod+Up focus up 85 | bindsym $mod+Right focus right 86 | 87 | # move focused window 88 | bindsym $mod+Shift+j move left 89 | bindsym $mod+Shift+k move down 90 | bindsym $mod+Shift+l move up 91 | bindsym $mod+Shift+semicolon move right 92 | 93 | # alternatively, you can use the cursor keys: 94 | bindsym $mod+Shift+Left move left 95 | bindsym $mod+Shift+Down move down 96 | bindsym $mod+Shift+Up move up 97 | bindsym $mod+Shift+Right move right 98 | 99 | # workspace back and forth (with/without active container) 100 | workspace_auto_back_and_forth yes 101 | bindsym $mod+b workspace back_and_forth 102 | bindsym $mod+Shift+b move container to workspace back_and_forth; workspace back_and_forth 103 | 104 | # split orientation 105 | bindsym $mod+h split h;exec notify-send 'tile horizontally' 106 | bindsym $mod+v split v;exec notify-send 'tile vertically' 107 | bindsym $mod+q split toggle 108 | 109 | # toggle fullscreen mode for the focused container 110 | bindsym $mod+f fullscreen toggle 111 | 112 | # change container layout (stacked, tabbed, toggle split) 113 | bindsym $mod+s layout stacking 114 | bindsym $mod+w layout tabbed 115 | bindsym $mod+e layout toggle split 116 | 117 | # toggle tiling / floating 118 | bindsym $mod+Shift+space floating toggle 119 | 120 | # change focus between tiling / floating windows 121 | bindsym $mod+space focus mode_toggle 122 | 123 | # toggle sticky 124 | bindsym $mod+Shift+s sticky toggle 125 | 126 | # focus the parent container 127 | bindsym $mod+a focus parent 128 | 129 | # move the currently focused window to the scratchpad 130 | bindsym $mod+Shift+minus move scratchpad 131 | 132 | # Show the next scratchpad window or hide the focused scratchpad window. 133 | # If there are multiple scratchpad windows, this command cycles through them. 134 | bindsym $mod+minus scratchpad show 135 | 136 | #navigate workspaces next / previous 137 | bindsym $mod+Ctrl+Right workspace next 138 | bindsym $mod+Ctrl+Left workspace prev 139 | 140 | # Workspace names 141 | # to display names or symbols instead of plain workspace numbers you can use 142 | # something like: set $ws1 1:mail 143 | # set $ws2 2: 144 | set $ws1 1 145 | set $ws2 2 146 | set $ws3 3 147 | set $ws4 4 148 | set $ws5 5 149 | set $ws6 6 150 | set $ws7 7 151 | set $ws8 8 152 | 153 | # switch to workspace 154 | bindsym $mod+1 workspace $ws1 155 | bindsym $mod+2 workspace $ws2 156 | bindsym $mod+3 workspace $ws3 157 | bindsym $mod+4 workspace $ws4 158 | bindsym $mod+5 workspace $ws5 159 | bindsym $mod+6 workspace $ws6 160 | bindsym $mod+7 workspace $ws7 161 | bindsym $mod+8 workspace $ws8 162 | 163 | # Move focused container to workspace 164 | bindsym $mod+Ctrl+1 move container to workspace $ws1 165 | bindsym $mod+Ctrl+2 move container to workspace $ws2 166 | bindsym $mod+Ctrl+3 move container to workspace $ws3 167 | bindsym $mod+Ctrl+4 move container to workspace $ws4 168 | bindsym $mod+Ctrl+5 move container to workspace $ws5 169 | bindsym $mod+Ctrl+6 move container to workspace $ws6 170 | bindsym $mod+Ctrl+7 move container to workspace $ws7 171 | bindsym $mod+Ctrl+8 move container to workspace $ws8 172 | 173 | # Move to workspace with focused container 174 | bindsym $mod+Shift+1 move container to workspace $ws1; workspace $ws1 175 | bindsym $mod+Shift+2 move container to workspace $ws2; workspace $ws2 176 | bindsym $mod+Shift+3 move container to workspace $ws3; workspace $ws3 177 | bindsym $mod+Shift+4 move container to workspace $ws4; workspace $ws4 178 | bindsym $mod+Shift+5 move container to workspace $ws5; workspace $ws5 179 | bindsym $mod+Shift+6 move container to workspace $ws6; workspace $ws6 180 | bindsym $mod+Shift+7 move container to workspace $ws7; workspace $ws7 181 | bindsym $mod+Shift+8 move container to workspace $ws8; workspace $ws8 182 | 183 | # Open applications on specific workspaces 184 | # assign [class="Thunderbird"] $ws1 185 | # assign [class="Pale moon"] $ws2 186 | # assign [class="Pcmanfm"] $ws3 187 | # assign [class="Skype"] $ws5 188 | 189 | # Open specific applications in floating mode 190 | for_window [title="alsamixer"] floating enable border pixel 1 191 | for_window [class="calamares"] floating enable border normal 192 | for_window [class="Clipgrab"] floating enable 193 | for_window [title="File Transfer*"] floating enable 194 | for_window [class="Galculator"] floating enable border pixel 1 195 | for_window [class="GParted"] floating enable border normal 196 | for_window [title="i3_help"] floating enable sticky enable border normal 197 | for_window [class="Lightdm-settings"] floating enable 198 | for_window [class="Lxappearance"] floating enable sticky enable border normal 199 | for_window [class="Manjaro-hello"] floating enable 200 | for_window [class="Manjaro Settings Manager"] floating enable border normal 201 | for_window [title="MuseScore: Play Panel"] floating enable 202 | for_window [class="Nitrogen"] floating enable sticky enable border normal 203 | for_window [class="Oblogout"] fullscreen enable 204 | for_window [class="octopi"] floating enable 205 | for_window [title="About Pale Moon"] floating enable 206 | for_window [class="Pamac-manager"] floating enable 207 | for_window [class="Pavucontrol"] floating enable 208 | for_window [class="qt5ct"] floating enable sticky enable border normal 209 | for_window [class="Qtconfig-qt4"] floating enable sticky enable border normal 210 | for_window [class="Simple-scan"] floating enable border normal 211 | for_window [class="(?i)System-config-printer.py"] floating enable border normal 212 | for_window [class="Skype"] floating enable border normal 213 | for_window [class="Timeset-gui"] floating enable border normal 214 | for_window [class="(?i)virtualbox"] floating enable border normal 215 | for_window [class="Xfburn"] floating enable 216 | 217 | # switch to workspace with urgent window automatically 218 | for_window [urgent=latest] focus 219 | 220 | # reload the configuration file 221 | bindsym $mod+Shift+c reload 222 | 223 | # restart i3 inplace (preserves your layout/session, can be used to upgrade i3) 224 | bindsym $mod+Shift+r restart 225 | 226 | # exit i3 (logs you out of your X session) 227 | bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'" 228 | 229 | # Set shut down, restart and locking features 230 | bindsym $mod+0 mode "$mode_system" 231 | set $mode_system (l)ock, (e)xit, switch_(u)ser, (s)uspend, (h)ibernate, (r)eboot, (Shift+s)hutdown 232 | mode "$mode_system" { 233 | bindsym l exec --no-startup-id i3exit lock, mode "default" 234 | bindsym s exec --no-startup-id i3exit suspend, mode "default" 235 | bindsym u exec --no-startup-id i3exit switch_user, mode "default" 236 | bindsym e exec --no-startup-id i3exit logout, mode "default" 237 | bindsym h exec --no-startup-id i3exit hibernate, mode "default" 238 | bindsym r exec --no-startup-id i3exit reboot, mode "default" 239 | bindsym Shift+s exec --no-startup-id i3exit shutdown, mode "default" 240 | 241 | # exit system mode: "Enter" or "Escape" 242 | bindsym Return mode "default" 243 | bindsym Escape mode "default" 244 | } 245 | 246 | # Resize window (you can also use the mouse for that) 247 | bindsym $mod+r mode "resize" 248 | mode "resize" { 249 | # These bindings trigger as soon as you enter the resize mode 250 | # Pressing left will shrink the window’s width. 251 | # Pressing right will grow the window’s width. 252 | # Pressing up will shrink the window’s height. 253 | # Pressing down will grow the window’s height. 254 | bindsym j resize shrink width 5 px or 5 ppt 255 | bindsym k resize grow height 5 px or 5 ppt 256 | bindsym l resize shrink height 5 px or 5 ppt 257 | bindsym semicolon resize grow width 5 px or 5 ppt 258 | 259 | # same bindings, but for the arrow keys 260 | bindsym Left resize shrink width 10 px or 10 ppt 261 | bindsym Down resize grow height 10 px or 10 ppt 262 | bindsym Up resize shrink height 10 px or 10 ppt 263 | bindsym Right resize grow width 10 px or 10 ppt 264 | 265 | # exit resize mode: Enter or Escape 266 | bindsym Return mode "default" 267 | bindsym Escape mode "default" 268 | } 269 | 270 | # Lock screen 271 | bindsym $mod+9 exec --no-startup-id blurlock 272 | 273 | # Autostart applications 274 | exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 275 | exec --no-startup-id nitrogen --restore; sleep 1; compton -b 276 | #exec --no-startup-id manjaro-hello 277 | exec --no-startup-id nm-applet 278 | exec --no-startup-id xfce4-power-manager 279 | exec --no-startup-id pamac-tray 280 | exec --no-startup-id clipit 281 | # exec --no-startup-id blueman-applet 282 | # exec_always --no-startup-id sbxkb 283 | exec --no-startup-id start_conky_maia 284 | # exec --no-startup-id start_conky_green 285 | exec --no-startup-id xautolock -time 10 -locker blurlock 286 | exec_always --no-startup-id ff-theme-util 287 | exec_always --no-startup-id fix_xcursor 288 | 289 | # Color palette used for the terminal ( ~/.Xresources file ) 290 | # Colors are gathered based on the documentation: 291 | # https://i3wm.org/docs/userguide.html#xresources 292 | # Change the variable name at the place you want to match the color 293 | # of your terminal like this: 294 | # [example] 295 | # If you want your bar to have the same background color as your 296 | # terminal background change the line 362 from: 297 | # background #14191D 298 | # to: 299 | # background $term_background 300 | # Same logic applied to everything else. 301 | set_from_resource $term_background background 302 | set_from_resource $term_foreground foreground 303 | set_from_resource $term_color0 color0 304 | set_from_resource $term_color1 color1 305 | set_from_resource $term_color2 color2 306 | set_from_resource $term_color3 color3 307 | set_from_resource $term_color4 color4 308 | set_from_resource $term_color5 color5 309 | set_from_resource $term_color6 color6 310 | set_from_resource $term_color7 color7 311 | set_from_resource $term_color8 color8 312 | set_from_resource $term_color9 color9 313 | set_from_resource $term_color10 color10 314 | set_from_resource $term_color11 color11 315 | set_from_resource $term_color12 color12 316 | set_from_resource $term_color13 color13 317 | set_from_resource $term_color14 color14 318 | set_from_resource $term_color15 color15 319 | 320 | # Start i3bar to display a workspace bar (plus the system information i3status if available) 321 | bar { 322 | i3bar_command i3bar 323 | status_command i3status 324 | position bottom 325 | 326 | ## please set your primary output first. Example: 'xrandr --output eDP1 --primary' 327 | # tray_output primary 328 | # tray_output eDP1 329 | 330 | bindsym button4 nop 331 | bindsym button5 nop 332 | # font xft:URWGothic-Book 11 333 | strip_workspace_numbers yes 334 | 335 | colors { 336 | background #222D31 337 | statusline #F9FAF9 338 | separator #454947 339 | 340 | # border backgr. text 341 | focused_workspace #F9FAF9 #16a085 #292F34 342 | active_workspace #595B5B #353836 #FDF6E3 343 | inactive_workspace #595B5B #222D31 #EEE8D5 344 | binding_mode #16a085 #2C2C2C #F9FAF9 345 | urgent_workspace #16a085 #FDF6E3 #E5201D 346 | } 347 | } 348 | 349 | # hide/unhide i3status bar 350 | bindsym $mod+m bar mode toggle 351 | 352 | # Theme colors 353 | # class border backgr. text indic. child_border 354 | client.focused #556064 #556064 #80FFF9 #FDF6E3 355 | client.focused_inactive #2F3D44 #2F3D44 #1ABC9C #454948 356 | client.unfocused #2F3D44 #2F3D44 #1ABC9C #454948 357 | client.urgent #CB4B16 #FDF6E3 #1ABC9C #268BD2 358 | client.placeholder #000000 #0c0c0c #ffffff #000000 359 | 360 | client.background #2B2C2B 361 | 362 | ############################# 363 | ### settings for i3-gaps: ### 364 | ############################# 365 | 366 | # Set inner/outer gaps 367 | gaps inner 14 368 | gaps outer -2 369 | 370 | # Additionally, you can issue commands with the following syntax. This is useful to bind keys to changing the gap size. 371 | # gaps inner|outer current|all set|plus|minus 372 | # gaps inner all set 10 373 | # gaps outer all plus 5 374 | 375 | # Smart gaps (gaps used if only more than one container on the workspace) 376 | smart_gaps on 377 | 378 | # Smart borders (draw borders around container only if it is not the only container on this workspace) 379 | # on|no_gaps (on=always activate and no_gaps=only activate if the gap size to the edge of the screen is 0) 380 | smart_borders on 381 | 382 | # Press $mod+Shift+g to enter the gap mode. Choose o or i for modifying outer/inner gaps. Press one of + / - (in-/decrement for current workspace) or 0 (remove gaps for current workspace). If you also press Shift with these keys, the change will be global for all workspaces. 383 | set $mode_gaps Gaps: (o) outer, (i) inner 384 | set $mode_gaps_outer Outer Gaps: +|-|0 (local), Shift + +|-|0 (global) 385 | set $mode_gaps_inner Inner Gaps: +|-|0 (local), Shift + +|-|0 (global) 386 | bindsym $mod+Shift+g mode "$mode_gaps" 387 | 388 | mode "$mode_gaps" { 389 | bindsym o mode "$mode_gaps_outer" 390 | bindsym i mode "$mode_gaps_inner" 391 | bindsym Return mode "default" 392 | bindsym Escape mode "default" 393 | } 394 | mode "$mode_gaps_inner" { 395 | bindsym plus gaps inner current plus 5 396 | bindsym minus gaps inner current minus 5 397 | bindsym 0 gaps inner current set 0 398 | 399 | bindsym Shift+plus gaps inner all plus 5 400 | bindsym Shift+minus gaps inner all minus 5 401 | bindsym Shift+0 gaps inner all set 0 402 | 403 | bindsym Return mode "default" 404 | bindsym Escape mode "default" 405 | } 406 | mode "$mode_gaps_outer" { 407 | bindsym plus gaps outer current plus 5 408 | bindsym minus gaps outer current minus 5 409 | bindsym 0 gaps outer current set 0 410 | 411 | bindsym Shift+plus gaps outer all plus 5 412 | bindsym Shift+minus gaps outer all minus 5 413 | bindsym Shift+0 gaps outer all set 0 414 | 415 | bindsym Return mode "default" 416 | bindsym Escape mode "default" 417 | } 418 | -------------------------------------------------------------------------------- /i3blocks.conf: -------------------------------------------------------------------------------- 1 | # i3blocks config file 2 | # 3 | # Please see man i3blocks for a complete reference! 4 | # The man page is also hosted at http://vivien.github.io/i3blocks 5 | # 6 | # List of valid properties: 7 | # 8 | # align 9 | # color 10 | # command 11 | # full_text 12 | # instance 13 | # interval 14 | # label 15 | # min_width 16 | # name 17 | # separator 18 | # separator_block_width 19 | # short_text 20 | # signal 21 | # urgent 22 | 23 | # Global properties 24 | separator_block_width=15 25 | command=/usr/lib/i3blocks/$BLOCK_NAME 26 | align=center 27 | separator=true 28 | separator_block_width=40 29 | markup=pango 30 | 31 | # Do make in bandwidth2 folder for this to work 32 | # [bandwidth] 33 | # label=⇅ 34 | # command=~/.i3/i3blocks-contrib/bandwidth2/bandwidth2 35 | # interval=persist 36 | # markup=pango 37 | # color=#8CE000 38 | 39 | [pomodoro] 40 | command=python ~/code/i3-pomodoro/pomodoro.py 41 | interval=1 42 | 43 | [temperature] 44 | command=~/.i3/i3blocks-contrib/temperature/temperature --chip 'coretemp-isa-000' 45 | label= 46 | interval=10 47 | color=#4ec2f7 48 | 49 | [texas] 50 | command=~/.i3/utils/date_with_tz.sh 'America/Los_Angeles' 51 | interval=5 52 | label=Calif: 53 | color=#ffb64c 54 | 55 | [india] 56 | command=~/.i3/utils/date_with_tz.sh 'Asia/Kolkata' 57 | interval=5 58 | label=India: 59 | color=#ffb64c 60 | 61 | # Do this if this block doesn't work 62 | # sudo apt install sysstat 63 | [cpu] 64 | label=CPU 65 | command=/usr/lib/i3blocks/cpu_usage 66 | interval=1 67 | color=#4ec2f7 68 | 69 | [ram] 70 | label=⚙ 71 | command=/usr/lib/i3blocks/memory 72 | interval=10 73 | color=#8CE000 74 | 75 | # Do this if this block doesn't work 76 | # sudo apt install acpi 77 | [battery] 78 | command=/usr/lib/i3blocks/battery 79 | label=⚡ 80 | interval=30 81 | color=#ef6191 82 | 83 | [time] 84 | command=date '+%a %d %B %Y %r' 85 | interval=5 86 | color=#ffb64c 87 | -------------------------------------------------------------------------------- /i3status.conf: -------------------------------------------------------------------------------- 1 | # i3status configuration file. 2 | # see "man i3status" for documentation. 3 | 4 | # It is important that this file is edited as UTF-8. 5 | # The following line should contain a sharp s: 6 | # ß 7 | # If the above line is not correctly displayed, fix your editor first! 8 | 9 | # TODO: https://github.com/addy-dclxvi/i3-starterpack/blob/master/.config/i3status/config 10 | 11 | general { 12 | colors = true 13 | markup = "pango" 14 | interval = 5 15 | color_good = "#2AA198" 16 | color_bad = "#586E75" 17 | color_degraded = "#DC322F" 18 | } 19 | 20 | # order += "ipv6" 21 | order += "pomodoro" 22 | # order += "cpu_usage" 23 | order += "clock" 24 | order += "disk /" 25 | # order += "disk /home" 26 | # order += "wireless _first_" 27 | # order += "ethernet _first_" 28 | # order += "load" 29 | order += "sysdata" 30 | order += "battery all" 31 | order += "tztime local" 32 | 33 | cpu_usage { 34 | format = " CPU: %usage " 35 | } 36 | 37 | sysdata { 38 | cpus = ['cpu'] 39 | format = "[\?color=cpu_used_percent CPU: {cpu_used_percent}%] [\?color=mem_used_percent Mem: {mem_used} {mem_total_unit}]" 40 | color="#8CE000" 41 | } 42 | 43 | load { 44 | format = " load %1min " 45 | # max_threshold = 0.3 46 | } 47 | 48 | clock { 49 | cycle = 5 50 | format = ["{America/Chicago}", "{Asia/Kolkata}", "{Asia/Singapore}"] 51 | format_time = "{name:11s} %H:%M" 52 | color = "#ffb64c" 53 | } 54 | 55 | disk "/" { 56 | format = " ⛁ %avail " 57 | color = "#8CE000" 58 | } 59 | 60 | ethernet _first_ { 61 | # if you use %speed, i3status requires root privileges 62 | format_up = " lan: %ip %speed " 63 | format_down = " no lan " 64 | } 65 | 66 | battery all { 67 | # format = "%status %percentage %remaining %emptytime" 68 | format = " %status %percentage" 69 | format_down = "No battery" 70 | last_full_capacity = true 71 | integer_battery_capacity = true 72 | # status_chr = "" 73 | status_chr = "⚡" 74 | # status_bat = "bat" 75 | # status_bat = "☉" 76 | status_bat = "⚡" 77 | # status_unk = "?" 78 | status_unk = "" 79 | # status_full = "" 80 | status_full = "⚡" 81 | low_threshold = 15 82 | threshold_type = time 83 | color = "#ef6191" 84 | } 85 | 86 | memory { 87 | format = "%used | %available" 88 | threshold_degraded = "1G" 89 | format_degraded = "MEMORY < %available" 90 | } 91 | 92 | tztime local { 93 | color = "#ffb64c" 94 | format = "%a %d %B %Y %r" 95 | #format = "%Y-%m-%d %H:%M:%S" 96 | # format = " %d.%m. %H:%M " 97 | } 98 | 99 | pomodoro { 100 | format = "{mmss} {bar}" 101 | } 102 | 103 | -------------------------------------------------------------------------------- /libinput-gestures.conf: -------------------------------------------------------------------------------- 1 | # Configuration file for libinput-gestures. 2 | # 3 | # The default configuration file exists at /etc/libinput-gestures.conf 4 | # but a user can create a personal custom configuration file at 5 | # ~/.config/libinput-gestures.conf. 6 | # 7 | # Lines starting with '#' and blank lines are ignored. Currently 8 | # "gesture" and "device" configuration keywords are supported as 9 | # described below. The keyword can optionally be appended with a ":" (to 10 | # maintain compatibility with original format configuration files). 11 | # 12 | # Each gesture line has 3 [or 4] arguments separated by whitespace: 13 | # 14 | # action motion [finger_count] command 15 | # 16 | # where action and motion is either: 17 | # swipe up 18 | # swipe down 19 | # swipe left 20 | # swipe right 21 | # pinch in 22 | # pinch out 23 | # 24 | # command is the remainder of the line and is any valid shell command + 25 | # arguments. 26 | # 27 | # finger_count is a single numeric digit and is optional (and is 28 | # typically 3 or 4). If specified then the command is executed when 29 | # exactly that number of fingers is used in the gesture. If not 30 | # specified then the command is executed when that gesture is executed 31 | # with any number of fingers. Gesture lines specified with finger_count 32 | # have priority over the same gesture specified without any 33 | # finger_count. 34 | # 35 | # Typically command will be xdotool, or wmctrl. See "man xdotool" for 36 | # the many things you can action with that tool. Note that unfortunately 37 | # xdotool does not work with native Wayland clients. 38 | 39 | ############################################################################### 40 | # SWIPE GESTURES: 41 | ############################################################################### 42 | 43 | # Note the default is an "internal" command that uses wmctrl to switch 44 | # workspaces and, unlike xdotool, works on both Xorg and Wayland (via 45 | # XWayland). It also can be configured for vertical and horizontal 46 | # switching over tabular workspaces, as per the example below. You can 47 | # also add "-w" to the internal command to allow wrapping workspaces. 48 | 49 | # Move to next workspace (works for GNOME/KDE/etc on Wayland and Xorg) 50 | gesture swipe left _internal ws_up 51 | 52 | # NOTE ABOUT FINGER COUNT: 53 | # The above command will configure this command for all fingers (i.e. 3 54 | # for 4) but to configure it for 3 fingers only, change it to: 55 | # gesture swipe up 3 _internal ws_up 56 | # Then you can configure something else for 4 fingers or leave 4 fingers 57 | # unconfigured. You can configure an explicit finger count like this for 58 | # all example commands in this configuration file. 59 | # 60 | # gesture swipe up xdotool key super+Page_Down 61 | 62 | # Move to prev workspace (works for GNOME/KDE/etc on Wayland and Xorg) 63 | gesture swipe right _internal ws_down 64 | # gesture swipe down xdotool key super+Page_Up 65 | 66 | # Browser go forward (works only for Xorg, and Xwayland clients) 67 | # gesture swipe left xdotool key alt+Right 68 | 69 | # Browser go back (works only for Xorg, and Xwayland clients) 70 | # gesture swipe right xdotool key alt+Left 71 | 72 | # NOTE: If you don't use "natural" scrolling direction for your touchpad 73 | # then you may want to swap the above default left/right and up/down 74 | # configurations. 75 | 76 | # Optional extended swipe gestures, e.g. for browser tab navigation: 77 | # 78 | # Jump to next open browser tab 79 | # gesture swipe right_up xdotool key control+Tab 80 | # 81 | # Jump to previous open browser tab 82 | # gesture swipe left_up xdotool key control+shift+Tab 83 | # 84 | # Close current browser tab 85 | # gesture swipe left_down xdotool key control+w 86 | # 87 | # Reopen and jump to last closed browser tab 88 | # gesture swipe right_down xdotool key control+shift+t 89 | 90 | # Example of 8 static workspaces, e.g. using KDE virtual-desktops, 91 | # arranged in 2 rows of 4 across using swipe up/down/left/right to 92 | # navigate in fixed planes. Must match how you have configured your 93 | # virtual desktops. 94 | # gesture swipe up _internal --col=2 ws_up 95 | # gesture swipe down _internal --col=2 ws_down 96 | # gesture swipe left _internal --row=4 ws_up 97 | # gesture swipe right _internal --row=4 ws_down 98 | 99 | # Example virtual desktop switching for Ubuntu Unity/Compiz. The 100 | # _internal command does not work for Compiz but you can explicitly 101 | # configure the swipe commands to work for a Compiz virtual 2 102 | # dimensional desktop as follows: 103 | # gesture swipe up xdotool key ctrl+alt+Up 104 | # gesture swipe down xdotool key ctrl+alt+Down 105 | # gesture swipe left xdotool key ctrl+alt+Left 106 | # gesture swipe right xdotool key ctrl+alt+Right 107 | 108 | # Example to change audio volume: 109 | # Note this only works on an Xorg desktop (not Wayland). 110 | # gesture swipe up xdotool key XF86AudioRaiseVolume 111 | # gesture swipe down xdotool key XF86AudioLowerVolume 112 | 113 | ############################################################################### 114 | # PINCH GESTURES: 115 | ############################################################################### 116 | 117 | # GNOME SHELL open/close overview (works for GNOME on Xorg only) 118 | # gesture pinch in xdotool key super+s 119 | # gesture pinch out xdotool key super+s 120 | 121 | # KDE Plasma open/close overview 122 | # gesture pinch in xdotool key ctrl+F9 123 | # gesture pinch out xdotool key ctrl+F9 124 | 125 | # GNOME SHELL open/close overview (works for GNOME on Wayland and Xorg) 126 | # Note since GNOME 3.24 on Wayland this is implemented natively so no 127 | # real point configuring for Wayland. 128 | # gesture pinch in dbus-send --session --type=method_call --dest=org.gnome.Shell /org/gnome/Shell org.gnome.Shell.Eval string:'Main.overview.toggle();' 129 | # gesture pinch out dbus-send --session --type=method_call --dest=org.gnome.Shell /org/gnome/Shell org.gnome.Shell.Eval string:'Main.overview.toggle();' 130 | 131 | # Optional extended pinch gestures: 132 | # gesture pinch clockwise 133 | # gesture pinch anticlockwise 134 | 135 | ############################################################################### 136 | # This application normally determines your touchpad device 137 | # automatically. Some users may have multiple touchpads but by default 138 | # we use only the first one found. However, you can choose to specify 139 | # the explicit device name to use. Run "libinput list-devices" to work 140 | # out the name of your device (from the "Device:" field). Then add a 141 | # device line specifying that name, e.g: 142 | # 143 | # device DLL0665:01 06CB:76AD Touchpad 144 | # 145 | # If the device name starts with a '/' then it is instead considered as 146 | # the explicit device path although since device paths can change 147 | # through reboots this is best to be a symlink. E.g. instead of specifying 148 | # /dev/input/event12, use the corresponding full path link under 149 | # /dev/input/by-path/*. 150 | # 151 | # You can choose to use ALL touchpad devices by setting the device name 152 | # to "all". E.g. Do this if you have multiple touchpads which you want 153 | # to use in parallel. This reduces performance slightly so only set this 154 | # if you have to. 155 | # 156 | # device all 157 | 158 | ############################################################################### 159 | # You can set a minimum travel distance threshold before swipe gestures 160 | # are actioned using the swipe_threshold configuration command. 161 | # Specify this value in dots. The default is 0. 162 | # E.g. set it to 100 dots with "swipe_threshold 100". 163 | # swipe_threshold 0 164 | 165 | ############################################################################### 166 | # You can set a timeout on gestures from start to end. The default is 167 | # the value commented below. It can be any value in float secs >= 0. 168 | # 0 = no timeout. E.g. set it to 2 secs with "timeout 2". 169 | # timeout 1.5 170 | -------------------------------------------------------------------------------- /myrmidon-tasks.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Screenshot", 4 | "command": "i3-scrot" 5 | }, 6 | { 7 | "name": "Screenshot selection", 8 | "command": "i3-scrot -s" 9 | } 10 | ] 11 | -------------------------------------------------------------------------------- /utils/brightness_decrease.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | sink=`xbacklight -get intel_backlight` 3 | sink=${sink%.*} 4 | if [ $sink -gt 15 ] 5 | then 6 | xbacklight -dec 5 intel_backlight 7 | else 8 | xbacklight -dec 1 intel_backlight 9 | fi 10 | notify-send $sink 11 | 12 | -------------------------------------------------------------------------------- /utils/brightness_gui.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | brightness=`xbacklight -get intel_backlight` 3 | brightnessInt=${brightness%.*} 4 | newBrightness=`zenity --scale --value=$brightnessInt` 5 | xbacklight -set $newBrightness intel_backlight 6 | notify-send $newBrightness 7 | 8 | -------------------------------------------------------------------------------- /utils/brightness_increase.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | sink=`xbacklight -get intel_backlight` 3 | sink=${sink%.*} 4 | if [ $sink -gt 15 ] 5 | then 6 | xbacklight -inc 5 intel_backlight 7 | else 8 | xbacklight -inc 1 intel_backlight 9 | fi 10 | notify-send $sink 11 | 12 | 13 | -------------------------------------------------------------------------------- /utils/connect_external_monitor.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding: utf-8 -*- 3 | import subprocess 4 | import json 5 | from i3_wm_multi_disp_scripts import necessaryFuncs as nf 6 | 7 | proc_out = subprocess.run(['i3-msg', '-t', 'get_workspaces'], stdout=subprocess.PIPE) 8 | wkList = json.loads(proc_out.stdout.decode('utf-8')) 9 | 10 | allWKNames = nf.getWKNames(wkList) 11 | 12 | internalDisplay = 'eDP-1-1' 13 | externalDisplays = [x for x in nf.getListOfOutputs(wkList) if x != internalDisplay] 14 | eachProjectWks = [nf.getWKNamesFromProj(wkList, x) for x in nf.getListOfProjects(wkList)] 15 | 16 | for eachProject in eachProjectWks: 17 | for i, x in enumerate(eachProject[1:]): 18 | commandToRun = 'workspace --no-auto-back-and-forth ' + x + '; ' +\ 19 | 'move workspace to output ' + externalDisplays[i] + '; ' 20 | commandToRun = ['i3-msg', commandToRun] 21 | subprocess.call(commandToRun) 22 | -------------------------------------------------------------------------------- /utils/date_with_tz.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | #TZ='Asia/Kolkata' date '+%I:%M %p' 3 | TZ=$1 date '+%I:%M %p' 4 | -------------------------------------------------------------------------------- /utils/disconnect_external_monitor.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding: utf-8 -*- 3 | import subprocess 4 | import json 5 | from i3_wm_multi_disp_scripts import necessaryFuncs as nf 6 | 7 | proc_out = subprocess.run(['i3-msg', '-t', 'get_workspaces'], stdout=subprocess.PIPE) 8 | wkList = json.loads(proc_out.stdout.decode('utf-8')) 9 | 10 | allWKNames = nf.getWKNames(wkList) 11 | 12 | internalDisplay = 'eDP-1-1' 13 | 14 | wksOnExternalDisplays = [x['name'] for x in wkList if x['output'] != internalDisplay] 15 | 16 | commandToRun = ''.join(['workspace --no-auto-back-and-forth ' + 17 | x + '; ' + 18 | 'move workspace to output ' + 19 | internalDisplay + '; ' for x in wksOnExternalDisplays]) 20 | 21 | commandToRun = ['i3-msg', commandToRun] 22 | 23 | subprocess.call(commandToRun) 24 | -------------------------------------------------------------------------------- /utils/gsls_script: -------------------------------------------------------------------------------- 1 | uniform bool invert_color; 2 | uniform sampler2D tex; 3 | void main() { 4 | vec4 c = texture2D(tex, gl_TexCoord[0].xy); 5 | float y = dot(c.rgb, vec3(0.299, 0.587, 0.114)); 6 | gl_FragColor = vec4(y, y, y, 1.0); 7 | } 8 | -------------------------------------------------------------------------------- /utils/map_touchscreen_to_laptop_screen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | xinput --map-to-output 'Wacom HID 5168 Pen stylus' eDP1 3 | xinput --map-to-output 'Wacom HID 5168 Finger touch' eDP1 4 | xinput --map-to-output 'Wacom HID 5168 Pen eraser' eDP1 5 | 6 | -------------------------------------------------------------------------------- /utils/to_grayscale.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # from https://github.com/chjj/compton/issues/530 3 | compton --backend glx --glx-fshader-win "$(cat ~/.i3/utils/gsls_script)" 4 | 5 | -------------------------------------------------------------------------------- /utils/touchpad_toggle.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # xinput list 4 | device=`xinput list --short | grep 'Touchpad' | sed 's/.*id=\([0-9]*\).*/\1/'` 5 | state=`xinput list-props "$device" | grep "Device Enabled" | grep -o "[01]$"` 6 | 7 | if [ $state == '1' ];then 8 | xinput --disable $device 9 | else 10 | xinput --enable $device 11 | fi 12 | 13 | -------------------------------------------------------------------------------- /utils/volume_decrease.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | sink=`pactl list short sinks | grep RUNNING | cut -f1` 3 | /usr/bin/pactl set-sink-volume $sink '-5%' 4 | 5 | SINK=$( pactl list short sinks | sed -e 's,^\([0-9][0-9]*\)[^0-9].*,\1,' | head -n 1 ) 6 | NOW=$( pactl list sinks | grep '^[[:space:]]Volume:' | head -n $(( $SINK + 1 )) | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,' ) 7 | notify-send "Volume- $NOW" -t 500 8 | 9 | -------------------------------------------------------------------------------- /utils/volume_increase.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | sink=`pactl list short sinks | grep RUNNING | cut -f1` 3 | /usr/bin/pactl set-sink-volume $sink '+5%' 4 | 5 | SINK=$( pactl list short sinks | sed -e 's,^\([0-9][0-9]*\)[^0-9].*,\1,' | head -n 1 ) 6 | NOW=$( pactl list sinks | grep '^[[:space:]]Volume:' | head -n $(( $SINK + 1 )) | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,' ) 7 | 8 | notify-send "Volume+ $NOW" -t 500 9 | -------------------------------------------------------------------------------- /utils/volume_mute.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | sink=`pactl list short sinks | grep RUNNING | cut -f1` 3 | notify-send "Volume Mute Toggle" -t 500 4 | /usr/bin/pactl set-sink-mute $sink toggle 5 | 6 | -------------------------------------------------------------------------------- /utils/xrandr-dmenu-zsh.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/zsh 2 | # https://github.com/JumperPunk/bin/blob/master/xrandr-dmenu 3 | # Setup outputs with xrandr as a backend and dmenu as a frontend 4 | # 5 | # external commands: cat, cut, dmenu, grep, sed, xrandr 6 | # Released under GPLv2 7 | # 8 | # TODO: add dpi support 9 | 10 | typeset XRANDR_TXT # readonly; stdout of running xrandr without any options 11 | typeset -A OUTPUT_CONFIGURED # key=connected output name 12 | typeset -a DISCONNECT_OUTPUTS 13 | typeset OPT_MODE='auto' 14 | typeset OPT_ROTATION='normal' 15 | typeset -ir EXIT_CLEAN=7 16 | typeset -ir ERR_BAD_ARGS=257 17 | typeset -ir ERR_BAD_SELECTION=258 18 | typeset -ir ERR_NO_OPTIONS=259 19 | 20 | if ! command -v cat &>/dev/null; then 21 | echo 'coreutils seem to be missing. You'\''re gonna have a bad time.' >&2 22 | exit 255 23 | elif ! command -v grep &>/dev/null; then 24 | echo 'grep seems to be missing. You'\''re gonna have a bad time.' >&2 25 | exit 255 26 | elif ! command -v xrandr &>/dev/null; then 27 | echo 'Ran xrandr-dmenu without xrandr? You'\''re gonna have a bad time.' >&2 28 | exit 255 29 | elif ! command -v dmenu &>/dev/null; then 30 | echo 'Ran xrandr-dmenu without dmenu? You'\''re gonna have a bad time.' >&2 31 | exit 255 32 | elif ! xset q &>/dev/null; then 33 | echo 'Woah there, cowboy! You need to run this from inside X!' >&2 34 | exit 1 35 | fi 36 | 37 | XRANDR_TXT="$(xrandr)" || exit $? 38 | 39 | function () { 40 | typeset opt 41 | typeset output 42 | typeset help_msg="usage: xrandr-dmenu [options] 43 | Setup X outputs position, mode, etc 44 | Input 'exit' or press 'ESC' at any point to cancel. 45 | 46 | Options: 47 | -m Select mode for outputs 48 | -M Use current mode for outputs 49 | -r Select rotation for outputs 50 | -R Use current rotation for outputs" 51 | 52 | while getopts mMrRh opt; do 53 | case "${opt}" in 54 | ('m') OPT_MODE='change' ;; 55 | ('M') OPT_MODE='no_change' ;; 56 | ('r') OPT_ROTATION='change' ;; 57 | ('R') OPT_ROTATION='no_change' ;; 58 | ('h') 59 | echo "${help_msg}" 60 | exit 0 61 | ;; 62 | ('?') 63 | echo "${help_msg}" 64 | exit 1 65 | ;; 66 | esac 67 | done 68 | 69 | for output in $(grep ' connected' <<< "${XRANDR_TXT}" | cut -d ' ' -f 1); do 70 | OUTPUT_CONFIGURED[${output}]='false' 71 | done 72 | for output ($(grep ' disconnected' <<< "${XRANDR_TXT}" | cut -d ' ' -f 1)) { 73 | DISCONNECTED_OUTPUTS+=("${output}") 74 | } 75 | } "$@" 76 | 77 | typeset -r XRANDR_TXT 78 | typeset -r OPT_MODE 79 | typeset -r OPT_ROTATION 80 | typeset -r DISCONNECTED_OUTPUTS 81 | 82 | function main() { 83 | typeset prompt 84 | typeset menu 85 | typeset output 86 | typeset mode 87 | typeset rotation 88 | typeset position 89 | typeset xrandr_cmd 90 | 91 | # set primary output 92 | prompt='Select primary output:' 93 | output="$(menu_select "${prompt}" ${(k)=OUTPUT_CONFIGURED})" || bail $? 94 | 95 | position='--primary' 96 | mode="$(select_mode ${output})" || bail $? 97 | rotation="$(select_rotation ${output})" || bail $? 98 | 99 | OUTPUT_CONFIGURED[${output}]='true' 100 | xrandr_cmd="xrandr --output ${output} ${position} ${rotation} ${mode}" 101 | 102 | # set additional outputs 103 | prompt='Select next output:' 104 | while ! all_outputs_configured; do 105 | menu="$(list_unconfigured_outputs)" 106 | output="$(menu_select ${prompt} ${=menu})" || bail $? 107 | 108 | position="$(select_position ${output})" || bail $? 109 | if [[ "${position}" != '--off' ]]; then 110 | mode="$(select_mode ${output})" || bail $? 111 | rotation="$(select_rotation ${output})" || bail $? 112 | fi 113 | 114 | OUTPUT_CONFIGURED[${output}]='true' 115 | xrandr_cmd+=" --output ${output} ${position} ${rotation} ${mode}" 116 | done 117 | 118 | # forcibly '--off' disconnected outputs 119 | for output in ${DISCONNECTED_OUTPUTS}; do 120 | xrandr_cmd+=" --output ${output} --off" 121 | done 122 | 123 | # do the deed 124 | if ! ${=xrandr_cmd}; then 125 | echo "Failed to execute xrandr command:\n${xrandr_cmd}" 126 | bail 255 127 | fi 128 | } 129 | 130 | ################################################################################ 131 | # Uses dmenu to select the position of a given output relative to an already 132 | # configured output. --same-as and --off are considered a position. 133 | # Prints in the form of xrandr option (eg, '--right-of DP1') to stdout 134 | # Global variables: 135 | # ERR_BAD_ARG 136 | # Arguments: 137 | # $1=name of output to configure 138 | # Returns: 139 | # ERR_BAD_ARG for no $1 140 | ################################################################################ 141 | function select_position() { 142 | [[ -z $1 ]] && return "${ERR_BAD_ARG}" 143 | 144 | typeset output 145 | typeset prompt 146 | typeset -a menu 147 | typeset anchor 148 | typeset position 149 | typeset selection 150 | output="$1" 151 | prompt="Select position of ${output}:" 152 | 153 | for anchor in $(list_configured_outputs); do 154 | for position in 'left of' 'right of' 'above' 'below' 'same as'; do 155 | menu+=("${position} ${anchor}") 156 | done 157 | done 158 | menu+=('off') 159 | selection="$(menu_select "${prompt}" ${menu})" || return $? 160 | 161 | case "${selection[(w)1]}" in 162 | (left|right|same) echo "--${selection/ /-}" ;; 163 | (above|below|mirror|off) echo "--${selection}" ;; 164 | esac 165 | } 166 | 167 | ################################################################################ 168 | # Uses dmenu to display the detected mode options for a given output and lets 169 | # the user select a mode to use. Prints choice in xrandr option format 170 | # (eg, '--mode 800x600' or '--auto') to stdout 171 | # Global variables: 172 | # XRANDR_TXT 173 | # OPT_MODE 174 | # ERR_BAD_ARGS 175 | # Arguments: 176 | # $1 - name of which output we are working with 177 | # Returns: 178 | # ERR_BAD_ARGS 179 | ################################################################################ 180 | function select_mode() { 181 | [[ -z $1 ]] && return "${ERR_BAD_ARGS}" 182 | 183 | typeset output 184 | typeset prompt 185 | typeset menu 186 | typeset selection 187 | output="$1" 188 | prompt="Select mode for ${output}:" 189 | 190 | 191 | if [[ "${OPT_MODE}" == 'auto' ]]; then 192 | echo '--auto' 193 | elif [[ "${OPT_MODE}" == 'no_change' ]]; then 194 | echo '' 195 | else 196 | # TODO: make this not ugly. A better sed should negate the need for cut/grep 197 | menu="$(echo \"${XRANDR_TXT}\" \ 198 | | sed -n '/^'${output}' /,/^[^ ]/ s/ * //p' \ 199 | | cut -d ' ' -f 1 \ 200 | | grep x \ 201 | | cat <(echo auto) -)" 202 | 203 | selection="$(menu_select "${prompt}" ${=menu})" || return $? 204 | 205 | if [[ 'auto' == "${selection}" ]]; then 206 | echo '--auto' 207 | else 208 | echo "--mode ${selection}" 209 | fi 210 | fi 211 | } 212 | 213 | ################################################################################ 214 | # Uses dmenu to select the rotation of a given output. Prints the selection in 215 | # xrandr option format (eg '--rotate inverted') to stdout 216 | # Global variables: 217 | # OPT_ROTATION 218 | # ERR_BAD_ARGS 219 | # Arguments: 220 | # $1 - name of which output we are working with 221 | # Returns: 222 | # ERR_BAD_ARGS 223 | ################################################################################ 224 | function select_rotation() { 225 | [[ -z $1 ]] && return "${ERR_BAD_ARGS}" 226 | 227 | typeset menu 228 | typeset prompt 229 | prompt="Select rotation of $1:" 230 | menu=('normal' 'inverted' 'left' 'right') 231 | 232 | if [[ "${OPT_ROTATION}" == 'normal' ]]; then 233 | echo '--rotate normal' 234 | elif [[ "${OPT_ROTATION}" == 'no_change' ]]; then 235 | echo '' 236 | else 237 | echo -n "--rotate ${selection}" 238 | menu_select "${prompt}" ${menu} || return $? 239 | fi 240 | } 241 | 242 | ################################################################################ 243 | # Uses dmenu to select an option. Undisplayed 'exit' option or pressing 'ESC' 244 | # will return code ${EXIT_CLEAN} to trigger an abort to the script. Validates to 245 | # make sure the selection is an option. If there is only 1 option, it will 246 | # automatically choose it. Prints selection to stdout 247 | # Global variables: 248 | # none 249 | # Arguments: 250 | # $1=prompt 251 | # $2+=menu items 252 | # Returns: 253 | # ERR_BAD_ARGS=bad arguments 254 | # EXIT_CLEAN=user requested exit 255 | ################################################################################ 256 | function menu_select() { 257 | [[ -z "$2" ]] && return ${ERR_BAD_ARGS} 258 | 259 | typeset selection 260 | typeset item 261 | typeset prompt 262 | typeset -a menu 263 | 264 | prompt="$1" 265 | shift 266 | menu=($*) 267 | 268 | if [[ ${#menu} == 1 ]]; then 269 | echo "${menu}" 270 | else 271 | while [[ -z "${menu[(r)${selection}]}" ]]; do 272 | echo "${(F)menu}" | dmenu -p "${prompt}" | read selection 273 | [[ "${(L)selection}" == 'exit' ]] || [[ -z "${selection}" ]] \ 274 | && return ${EXIT_CLEAN} 275 | done 276 | echo "${selection}" 277 | fi 278 | } 279 | 280 | function list_configured_outputs() { 281 | typeset -a list 282 | typeset output 283 | 284 | for output in ${(k)OUTPUT_CONFIGURED}; do 285 | ${OUTPUT_CONFIGURED[$output]} && list+=("${output}") 286 | done 287 | echo "${(F)list}" 288 | } 289 | 290 | function list_unconfigured_outputs() { 291 | typeset -a list 292 | typeset output 293 | 294 | for output in ${(k)OUTPUT_CONFIGURED}; do 295 | ${OUTPUT_CONFIGURED[$output]} || list+=("${output}") 296 | done 297 | echo "${(F)list}" 298 | } 299 | 300 | function all_outputs_configured() { 301 | typeset config 302 | 303 | for config in ${OUTPUT_CONFIGURED}; do 304 | $config || return 257 305 | done 306 | 307 | return 0 308 | } 309 | 310 | function bail() { 311 | [[ "$1" == ${EXIT_CLEAN} ]] && exit 0 || exit "$1" 312 | } 313 | 314 | main 315 | 316 | ################################################################################ 317 | # vim filetype=zsh autoindent expandtab shiftwidth=2 tabstop=2 318 | # End 319 | # 320 | --------------------------------------------------------------------------------