├── README.md ├── screen1.png ├── screen2.png ├── polybar ├── gmail │ ├── preview.png │ ├── pyproject.toml │ ├── list_labels.py │ ├── auth.py │ ├── LICENSE │ ├── README.md │ ├── launch.py │ └── poetry.lock ├── launch.sh ├── pacman_update.sh ├── spotify_status.py └── config ├── rofi ├── config.rasi └── themes │ └── nord-center.rasi ├── .Xresources └── i3 ├── config └── picom.conf /README.md: -------------------------------------------------------------------------------- 1 | # i3-config-files 2 | 3 | ![](screen1.png) 4 | ![](screen2.png) 5 | -------------------------------------------------------------------------------- /screen1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaanf/i3wm-config/HEAD/screen1.png -------------------------------------------------------------------------------- /screen2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaanf/i3wm-config/HEAD/screen2.png -------------------------------------------------------------------------------- /polybar/gmail/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaanf/i3wm-config/HEAD/polybar/gmail/preview.png -------------------------------------------------------------------------------- /rofi/config.rasi: -------------------------------------------------------------------------------- 1 | configuration { 2 | theme: "/home/kaan/.config/rofi/themes/nord-center.rasi"; 3 | } 4 | -------------------------------------------------------------------------------- /polybar/launch.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Terminate already running bar instances 4 | killall -q polybar 5 | # If all your bars have ipc enabled, you can also use 6 | # polybar-msg cmd quit 7 | 8 | # Launch bar1 and bar2 9 | echo "---" | tee -a /tmp/polybar1.log /tmp/polybar2.log 10 | polybar example 2>&1 | tee -a /tmp/polybar1.log & disown 11 | 12 | echo "Bars launched..." 13 | -------------------------------------------------------------------------------- /polybar/gmail/pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.poetry] 2 | name = "polybar-gmail" 3 | version = "0.1.0" 4 | description = "A Polybar module to show unread messages from Gmail" 5 | authors = ["Vyacheslav Konovalov "] 6 | license = "MIT" 7 | 8 | [tool.poetry.dependencies] 9 | python = "^3.8" 10 | google-api-python-client = "^1.8.2" 11 | google-auth-httplib2 = "^0.0.3" 12 | google-auth-oauthlib = "^0.4.1" 13 | 14 | [tool.poetry.dev-dependencies] 15 | 16 | [build-system] 17 | requires = ["poetry>=0.12"] 18 | build-backend = "poetry.masonry.api" 19 | -------------------------------------------------------------------------------- /polybar/pacman_update.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if ! updates_arch=$(checkupdates 2> /dev/null | wc -l ); then 4 | updates_arch=0 5 | fi 6 | 7 | if ! updates_aur=$(yay -Qum 2> /dev/null | wc -l); then 8 | # if ! updates_aur=$(cower -u 2> /dev/null | wc -l); then 9 | # if ! updates_aur=$(trizen -Su --aur --quiet | wc -l); then 10 | # if ! updates_aur=$(pikaur -Qua 2> /dev/null | wc -l); then 11 | # if ! updates_aur=$(rua upgrade --printonly 2> /dev/null | wc -l); then 12 | updates_aur=0 13 | fi 14 | 15 | updates=$(("$updates_arch" + "$updates_aur")) 16 | 17 | if [ "$updates" -gt 0 ]; then 18 | echo "# $updates" 19 | else 20 | echo "" 21 | fi 22 | -------------------------------------------------------------------------------- /polybar/gmail/list_labels.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import sys 5 | from googleapiclient.discovery import build 6 | from google.oauth2.credentials import Credentials 7 | 8 | DIR = os.path.dirname(os.path.realpath(__file__)) 9 | CREDENTIALS_PATH = os.path.join(DIR, 'credentials.json') 10 | 11 | try: 12 | creds = Credentials.from_authorized_user_file(CREDENTIALS_PATH) 13 | except FileNotFoundError: 14 | sys.exit('File ' + CREDENTIALS_PATH + ' not found. Run auth.py to obtain credentials.') 15 | gmail = build('gmail', 'v1', credentials=creds) 16 | labels = gmail.users().labels().list(userId='me').execute() 17 | for label in labels['labels']: 18 | print(label['id']) 19 | -------------------------------------------------------------------------------- /rofi/themes/nord-center.rasi: -------------------------------------------------------------------------------- 1 | /** 2 | * D-Nord : Rofi dmenu theme using the nord pallette 3 | */ 4 | * { 5 | background-color: rgba ( 59, 66, 82, 0 % ); 6 | text-color: rgba ( 255, 255, 255, 100 % ); 7 | font: "SF Pro Display 10"; 8 | } 9 | 10 | #window { 11 | transparency: "real"; 12 | anchor: south; 13 | location: south; 14 | width: 99.5%; 15 | padding: 5px; 16 | children: [ horibox ]; 17 | } 18 | 19 | #horibox { 20 | orientation: horizontal; 21 | children: [ prompt, entry, listview ]; 22 | } 23 | 24 | #listview { 25 | layout: horizontal; 26 | spacing: 2px; 27 | lines: 100; 28 | } 29 | 30 | #entry { 31 | expand: false; 32 | width: 8em; 33 | } 34 | 35 | #element { 36 | padding: 0px 25px; 37 | } 38 | #element selected { 39 | text-color: rgba ( 0, 0, 0, 100 % ); 40 | background-color: rgba ( 255, 255, 255, 100 % ); 41 | } 42 | 43 | -------------------------------------------------------------------------------- /polybar/gmail/auth.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from pathlib import Path 4 | from google.oauth2.credentials import Credentials 5 | from google_auth_oauthlib.flow import InstalledAppFlow 6 | from google.auth.transport.requests import Request 7 | 8 | SCOPE = 'https://www.googleapis.com/auth/gmail.labels' 9 | DIR = Path(__file__).resolve().parent 10 | CLIENT_SECRETS_PATH = Path(DIR, 'client_secrets.json') 11 | CREDENTIALS_PATH = Path(DIR, 'credentials.json') 12 | 13 | if Path(CREDENTIALS_PATH).is_file(): 14 | creds = Credentials.from_authorized_user_file(CREDENTIALS_PATH) 15 | if creds.expired and creds.refresh_token: 16 | creds.refresh(Request()) 17 | else: 18 | print('Credentials looks ok, try to remove credentials.json if something doesn\'t work') 19 | exit() 20 | else: 21 | flow = InstalledAppFlow.from_client_secrets_file(CLIENT_SECRETS_PATH, scopes=[SCOPE]) 22 | creds = flow.run_console() 23 | 24 | # Save credentials 25 | with open(CREDENTIALS_PATH, 'w') as creds_file: 26 | creds_file.write(creds.to_json()) 27 | print('Credentials successfully refreshed/created') 28 | -------------------------------------------------------------------------------- /polybar/gmail/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2019 Vyacheslav Konovalov https://github.com/vyachkonovalov 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /polybar/gmail/README.md: -------------------------------------------------------------------------------- 1 | # Polybar Gmail 2 | 3 | A [Polybar](https://github.com/jaagr/polybar) module to show unread messages from Gmail. 4 | 5 | ![preview](https://github.com/vyachkonovalov/polybar-gmail/raw/master/preview.png) 6 | 7 | ## Dependencies 8 | 9 | ```sh 10 | pip install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib 11 | # or use poetry 12 | ``` 13 | 14 | **Font Awesome** - default email icon 15 | 16 | **canberra-gtk-play** - new email sound notification 17 | 18 | You can change the icon or turn off sound, for more info see [script arguments](#script-arguments) 19 | 20 | ## Installation 21 | 22 | ```sh 23 | cd ~/.config/polybar 24 | curl -LO https://github.com/vyachkonovalov/polybar-gmail/archive/master.tar.gz 25 | tar zxf master.tar.gz && rm master.tar.gz 26 | mv polybar-gmail-master gmail 27 | ``` 28 | 29 | and obtain/refresh credentials 30 | 31 | ```sh 32 | ~/.config/polybar/gmail/auth.py 33 | ``` 34 | 35 | ### Module 36 | 37 | ```ini 38 | [module/gmail] 39 | type = custom/script 40 | exec = ~/.config/polybar/gmail/launch.py 41 | tail = true 42 | click-left = xdg-open https://mail.google.com 43 | ``` 44 | 45 | ## Script arguments 46 | 47 | `-l` or `--label` - set user's mailbox [label](https://developers.google.com/gmail/api/v1/reference/users/labels/list), default: INBOX 48 | 49 | `-p` or `--prefix` - set email icon, default:  50 | 51 | `-c` or `--color` - set new email icon color, default: #e06c75 52 | 53 | `-ns` or `--nosound` - turn off new email sound 54 | 55 | ### Example 56 | 57 | ```sh 58 | ./launch.py --label 'CATEGORY_PERSONAL' --prefix '✉' --color '#be5046' --nosound 59 | ``` 60 | 61 | ## Get list of all your mailbox labels 62 | 63 | ```python 64 | ./list_labels.py 65 | ``` 66 | -------------------------------------------------------------------------------- /.Xresources: -------------------------------------------------------------------------------- 1 | ! Appearance 2 | urxvt.termName: rxvt-unicode 3 | urxvt.scrollBar: false 4 | urxvt.background: black 5 | urxvt.foreground: white 6 | !! Font prefferenes 7 | ! urxvt.font: xft:DejaVu Sans Mono:style=Bold:pixelsize=13 8 | ! urxvt.boldFont: xft:DejaVu Sans Mono:pixelsize=13:weight=bold 9 | urxvt.font: xft:MesloLGS NF:style=Bold:pixelsize=14 10 | ! urxvt.font: xft:MesloLGS NF:style=Regular:pixelsize=15 11 | urxvt.letterSpace: -1 12 | !! Larger history limit 13 | urxvt.saveLines: 1000000 14 | urxvt.transparent: true 15 | urxvt.shading: 55 16 | urxvt.blurRadius: 12 17 | 18 | !! Perl extensions 19 | urxvt.perl-ext-common: default,matcher,font-size 20 | !! Open urls in browser with Control-Click 21 | urxvt.urlLauncher: /usr/bin/firefox 22 | urxvt.matcher.button: C1 23 | !! Change font size on Control-Plus/Minus 24 | URxvt.keysym.Control-0x2b: perl:font-size:increase 25 | URxvt.keysym.Control-0x2d: perl:font-size:decrease 26 | 27 | !! Tango color theme 28 | !! Strange - it matches tango from gnome-terminal, but looks different 29 | URxvt.color0: rgb:00/00/00 30 | URxvt.color1: rgb:CC/00/00 31 | !!URxvt.color2: rgb:4E/9A/06 32 | URxvt.color2: rgb:f9/f0/76 33 | URxvt.color3: rgb:C4/A0/00 34 | URxvt.color4: rgb:34/65/A4 35 | URxvt.color5: rgb:75/50/7B 36 | URxvt.color6: rgb:06/98/9A 37 | URxvt.color7: rgb:D3/D7/CF 38 | URxvt.color8: rgb:55/57/53 39 | URxvt.color9: rgb:EF/29/29 40 | URxvt.color10: rgb:8A/E2/34 41 | URxvt.color11: rgb:FC/E9/4F 42 | URxvt.color12: rgb:72/9F/CF 43 | URxvt.color13: rgb:AD/7F/A8 44 | URxvt.color14: rgb:34/E2/E2 45 | URxvt.color15: rgb:EE/EE/EC 46 | URxvt.colorBD: rgb:ff/ff/ff 47 | 48 | !! Copy Paste 49 | URxvt.keysym.Shift-Control-V: eval:paste_clipboard 50 | URxvt.keysym.Shift-Control-C: eval:selection_to_clipboard 51 | 52 | !! Padding 53 | URxvt.internalBorder: 20 54 | -------------------------------------------------------------------------------- /polybar/gmail/launch.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import time 4 | import argparse 5 | import subprocess 6 | from pathlib import Path 7 | from googleapiclient import discovery, errors 8 | from google.oauth2.credentials import Credentials 9 | from httplib2 import ServerNotFoundError 10 | 11 | parser = argparse.ArgumentParser() 12 | parser.add_argument('-l', '--label', default='INBOX') 13 | parser.add_argument('-p', '--prefix', default='\uf0e0') 14 | parser.add_argument('-c', '--color', default='#e06c75') 15 | parser.add_argument('-ns', '--nosound', action='store_true') 16 | args = parser.parse_args() 17 | 18 | DIR = Path(__file__).resolve().parent 19 | CREDENTIALS_PATH = Path(DIR, 'credentials.json') 20 | 21 | unread_prefix = '%{F' + args.color + '}' + '📥 ' + ' %{F-}' 22 | error_prefix = '%{F' + args.color + '}\uf06a %{F-}' 23 | count_was = 0 24 | 25 | def print_count(count, is_odd=False): 26 | tilde = '~' if is_odd else '' 27 | output = '' 28 | if count > 0: 29 | output = unread_prefix + tilde + str(count) + ' Unread Messages' 30 | else: 31 | output = (args.prefix + ' ' + tilde).strip() 32 | print(output, flush=True) 33 | 34 | def update_count(count_was): 35 | creds = Credentials.from_authorized_user_file(CREDENTIALS_PATH) 36 | gmail = discovery.build('gmail', 'v1', credentials=creds) 37 | labels = gmail.users().labels().get(userId='me', id=args.label).execute() 38 | count = labels['messagesUnread'] 39 | print_count(count) 40 | if not args.nosound and count_was < count and count > 0: 41 | subprocess.run(['canberra-gtk-play', '-i', 'message']) 42 | return count 43 | 44 | print_count(0, True) 45 | 46 | while True: 47 | try: 48 | if Path(CREDENTIALS_PATH).is_file(): 49 | count_was = update_count(count_was) 50 | time.sleep(10) 51 | else: 52 | print(error_prefix + 'credentials not found', flush=True) 53 | time.sleep(2) 54 | except errors.HttpError as error: 55 | if error.resp.status == 404: 56 | print(error_prefix + f'"{args.label}" label not found', flush=True) 57 | else: 58 | print_count(count_was, True) 59 | time.sleep(5) 60 | except (ServerNotFoundError, OSError): 61 | print_count(count_was, True) 62 | time.sleep(5) 63 | -------------------------------------------------------------------------------- /polybar/spotify_status.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import sys 4 | import dbus 5 | import argparse 6 | 7 | parser = argparse.ArgumentParser() 8 | parser.add_argument( 9 | '-t', 10 | '--trunclen', 11 | type=int, 12 | metavar='trunclen' 13 | ) 14 | parser.add_argument( 15 | '-f', 16 | '--format', 17 | type=str, 18 | metavar='custom format', 19 | dest='custom_format' 20 | ) 21 | parser.add_argument( 22 | '-p', 23 | '--playpause', 24 | type=str, 25 | metavar='play-pause indicator', 26 | dest='play_pause' 27 | ) 28 | parser.add_argument( 29 | '--font', 30 | type=str, 31 | metavar='the index of the font to use for the main label', 32 | dest='font' 33 | ) 34 | parser.add_argument( 35 | '--playpause-font', 36 | type=str, 37 | metavar='the index of the font to use to display the playpause indicator', 38 | dest='play_pause_font' 39 | ) 40 | parser.add_argument( 41 | '-q', 42 | '--quiet', 43 | action='store_true', 44 | help="if set, don't show any output when the current song is paused", 45 | dest='quiet', 46 | ) 47 | 48 | args = parser.parse_args() 49 | 50 | 51 | def fix_string(string): 52 | # corrects encoding for the python version used 53 | if sys.version_info.major == 3: 54 | return string 55 | else: 56 | return string.encode('utf-8') 57 | 58 | 59 | def truncate(name, trunclen): 60 | if len(name) > trunclen: 61 | name = name[:trunclen] 62 | name += '...' 63 | if ('(' in name) and (')' not in name): 64 | name += ')' 65 | return name 66 | 67 | 68 | 69 | # Default parameters 70 | output = fix_string(u'{play_pause} {artist}: {song}') 71 | trunclen = 35 72 | play_pause = fix_string(u'\u25B6,\u23F8') # first character is play, second is paused 73 | 74 | label_with_font = '%{{T{font}}}{label}%{{T-}}' 75 | font = args.font 76 | play_pause_font = args.play_pause_font 77 | 78 | quiet = args.quiet 79 | 80 | # parameters can be overwritten by args 81 | if args.trunclen is not None: 82 | trunclen = args.trunclen 83 | if args.custom_format is not None: 84 | output = args.custom_format 85 | if args.play_pause is not None: 86 | play_pause = args.play_pause 87 | 88 | try: 89 | session_bus = dbus.SessionBus() 90 | spotify_bus = session_bus.get_object( 91 | 'org.mpris.MediaPlayer2.spotify', 92 | '/org/mpris/MediaPlayer2' 93 | ) 94 | 95 | spotify_properties = dbus.Interface( 96 | spotify_bus, 97 | 'org.freedesktop.DBus.Properties' 98 | ) 99 | 100 | metadata = spotify_properties.Get('org.mpris.MediaPlayer2.Player', 'Metadata') 101 | status = spotify_properties.Get('org.mpris.MediaPlayer2.Player', 'PlaybackStatus') 102 | 103 | # Handle play/pause label 104 | 105 | play_pause = play_pause.split(',') 106 | 107 | if status == 'Playing': 108 | play_pause = play_pause[0] 109 | elif status == 'Paused': 110 | play_pause = play_pause[1] 111 | else: 112 | play_pause = str() 113 | 114 | if play_pause_font: 115 | play_pause = label_with_font.format(font=play_pause_font, label=play_pause) 116 | 117 | # Handle main label 118 | 119 | artist = fix_string(metadata['xesam:artist'][0]) if metadata['xesam:artist'] else '' 120 | song = fix_string(metadata['xesam:title']) if metadata['xesam:title'] else '' 121 | album = fix_string(metadata['xesam:album']) if metadata['xesam:album'] else '' 122 | 123 | if (quiet and status == 'Paused') or (not artist and not song and not album): 124 | print('') 125 | else: 126 | if font: 127 | artist = label_with_font.format(font=font, label=artist) 128 | song = label_with_font.format(font=font, label=song) 129 | album = label_with_font.format(font=font, label=album) 130 | 131 | # Add 4 to trunclen to account for status symbol, spaces, and other padding characters 132 | print(truncate(output.format(artist=artist, 133 | song=song, 134 | play_pause=play_pause, 135 | album=album), trunclen + 4)) 136 | 137 | except Exception as e: 138 | if isinstance(e, dbus.exceptions.DBusException): 139 | print('') 140 | else: 141 | print(e) 142 | -------------------------------------------------------------------------------- /i3/config: -------------------------------------------------------------------------------- 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 https://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 | font pango:monospace 8 17 | 18 | # This font is widely installed, provides lots of unicode glyphs, right-to-left 19 | # text rendering and scalability on retina/hidpi displays (thanks to pango). 20 | #font pango:DejaVu Sans Mono 8 21 | 22 | # The combination of xss-lock, nm-applet and pactl is a popular choice, so 23 | # they are included here as an example. Modify as you see fit. 24 | 25 | # xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the 26 | # screen before suspend. Use loginctl lock-session to lock your screen. 27 | exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork 28 | 29 | # NetworkManager is the most popular way to manage wireless networks on Linux, 30 | # and nm-applet is a desktop environment-independent system tray GUI for it. 31 | exec --no-startup-id nm-applet 32 | 33 | # Use pactl to adjust volume in PulseAudio. 34 | set $refresh_i3status killall -SIGUSR1 i3status 35 | bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status 36 | bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status 37 | bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status 38 | bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status 39 | 40 | # Use Mouse+$mod to drag floating windows to their wanted position 41 | floating_modifier $mod 42 | 43 | # start a terminal 44 | bindsym $mod+Return exec i3-sensible-terminal 45 | 46 | # kill focused window 47 | bindsym $mod+q kill 48 | 49 | # start dmenu (a program launcher) 50 | # bindsym $mod+g exec --no-startup-id dmenu_run 51 | # A more modern dmenu replacement is rofi: 52 | bindsym $mod+d exec rofi -show drun -display-drun "Search " 53 | bindsym $mod+g exec rofi -show run -display-run "Search packages " 54 | # There also is i3-dmenu-desktop which only displays applications shipping a 55 | # .desktop file. It is a wrapper around dmenu, so you need that installed. 56 | # bindsym $mod+d exec --no-startup-id i3-dmenu-desktop 57 | 58 | # change focus 59 | bindsym $mod+j focus left 60 | bindsym $mod+k focus down 61 | bindsym $mod+l focus up 62 | bindsym $mod+semicolon focus right 63 | 64 | # alternatively, you can use the cursor keys: 65 | bindsym $mod+Left focus left 66 | bindsym $mod+Down focus down 67 | bindsym $mod+Up focus up 68 | bindsym $mod+Right focus right 69 | 70 | # move focused window 71 | bindsym $mod+Shift+j move left 72 | bindsym $mod+Shift+k move down 73 | bindsym $mod+Shift+l move up 74 | bindsym $mod+Shift+semicolon move right 75 | 76 | # alternatively, you can use the cursor keys: 77 | bindsym $mod+Shift+Left move left 78 | bindsym $mod+Shift+Down move down 79 | bindsym $mod+Shift+Up move up 80 | bindsym $mod+Shift+Right move right 81 | 82 | # split in horizontal orientation 83 | bindsym $mod+h split h 84 | 85 | # split in vertical orientation 86 | bindsym $mod+v split v 87 | 88 | # enter fullscreen mode for the focused container 89 | bindsym $mod+f fullscreen toggle 90 | 91 | # change container layout (stacked, tabbed, toggle split) 92 | bindsym $mod+s layout stacking 93 | bindsym $mod+w layout tabbed 94 | bindsym $mod+e layout toggle split 95 | 96 | # toggle tiling / floating 97 | bindsym $mod+Shift+space floating toggle 98 | 99 | # change focus between tiling / floating windows 100 | bindsym $mod+space focus mode_toggle 101 | 102 | # focus the parent container 103 | bindsym $mod+a focus parent 104 | 105 | # focus the child container 106 | #bindsym $mod+d focus child 107 | 108 | # Define names for default workspaces for which we configure key bindings later on. 109 | # We use variables to avoid repeating the names in multiple places. 110 | set $ws1 "1: Workspace" 111 | set $ws2 "2: Spotify" 112 | set $ws3 "3: Firefox" 113 | set $ws4 "4" 114 | set $ws5 "5" 115 | set $ws6 "6" 116 | set $ws7 "7" 117 | set $ws8 "8" 118 | set $ws9 "9" 119 | set $ws10 "10" 120 | 121 | # switch to workspace 122 | bindsym $mod+1 workspace number $ws1 123 | bindsym $mod+2 workspace number $ws2 124 | bindsym $mod+3 workspace number $ws3 125 | bindsym $mod+4 workspace number $ws4 126 | bindsym $mod+5 workspace number $ws5 127 | bindsym $mod+6 workspace number $ws6 128 | bindsym $mod+7 workspace number $ws7 129 | bindsym $mod+8 workspace number $ws8 130 | bindsym $mod+9 workspace number $ws9 131 | bindsym $mod+0 workspace number $ws10 132 | 133 | # move focused container to workspace 134 | bindsym $mod+Shift+1 move container to workspace number $ws1 135 | bindsym $mod+Shift+2 move container to workspace number $ws2 136 | bindsym $mod+Shift+3 move container to workspace number $ws3 137 | bindsym $mod+Shift+4 move container to workspace number $ws4 138 | bindsym $mod+Shift+5 move container to workspace number $ws5 139 | bindsym $mod+Shift+6 move container to workspace number $ws6 140 | bindsym $mod+Shift+7 move container to workspace number $ws7 141 | bindsym $mod+Shift+8 move container to workspace number $ws8 142 | bindsym $mod+Shift+9 move container to workspace number $ws9 143 | bindsym $mod+Shift+0 move container to workspace number $ws10 144 | 145 | # reload the configuration file 146 | bindsym $mod+Shift+c reload 147 | # restart i3 inplace (preserves your layout/session, can be used to upgrade i3) 148 | bindsym $mod+Shift+r restart 149 | # exit i3 (logs you out of your X session) 150 | 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'" 151 | 152 | # resize window (you can also use the mouse for that) 153 | mode "resize" { 154 | # These bindings trigger as soon as you enter the resize mode 155 | 156 | # Pressing left will shrink the window’s width. 157 | # Pressing right will grow the window’s width. 158 | # Pressing up will shrink the window’s height. 159 | # Pressing down will grow the window’s height. 160 | bindsym j resize shrink width 10 px or 10 ppt 161 | bindsym k resize grow height 10 px or 10 ppt 162 | bindsym l resize shrink height 10 px or 10 ppt 163 | bindsym semicolon resize grow width 10 px or 10 ppt 164 | 165 | # same bindings, but for the arrow keys 166 | bindsym Left resize shrink width 10 px or 10 ppt 167 | bindsym Down resize grow height 10 px or 10 ppt 168 | bindsym Up resize shrink height 10 px or 10 ppt 169 | bindsym Right resize grow width 10 px or 10 ppt 170 | 171 | # back to normal: Enter or Escape or $mod+r 172 | bindsym Return mode "default" 173 | bindsym Escape mode "default" 174 | bindsym $mod+r mode "default" 175 | } 176 | 177 | bindsym $mod+r mode "resize" 178 | 179 | # Disable window titlebars entirely 180 | for_window [class="^.*"] border pixel 1 181 | 182 | gaps inner 10 183 | gaps outer 15 184 | 185 | smart_borders on 186 | 187 | set $mode_gaps Gaps: (o) outer, (i) inner 188 | set $mode_gaps_outer Outer Gaps: +|-|0 (local), Shift + +|-|0 (global) 189 | set $mode_gaps_inner Inner Gaps: +|-|0 (local), Shift + +|-|0 (global) 190 | bindsym $mod+Shift+g mode "$mode_gaps" 191 | 192 | mode "$mode_gaps" { 193 | bindsym o mode "$mode_gaps_outer" 194 | bindsym i mode "$mode_gaps_inner" 195 | bindsym Return mode "default" 196 | bindsym Escape mode "default" 197 | } 198 | 199 | mode "$mode_gaps_inner" { 200 | bindsym plus gaps inner current plus 5 201 | bindsym minus gaps inner current minus 5 202 | bindsym 0 gaps inner current set 0 203 | 204 | bindsym Shift+plus gaps inner all plus 5 205 | bindsym Shift+minus gaps inner all minus 5 206 | bindsym Shift+0 gaps inner all set 5 207 | 208 | bindsym Return mode "default" 209 | bindsym Escape mode "default" 210 | } 211 | 212 | mode "$mode_gaps_outer" { 213 | bindsym plus gaps outer current plus 5 214 | bindsym minus gaps outer current minus 5 215 | bindsym 0 gaps outer current set 0 216 | 217 | bindsym Shift+plus gaps outer all plus 5 218 | bindsym Shift+minus gaps outer all minus 5 219 | bindsym Shift+0 gaps outer all set 5 220 | 221 | bindsym Return mode "default" 222 | bindsym Escape mode "default" 223 | } 224 | 225 | # Start i3bar to display a workspace bar (plus the system information i3status 226 | # finds out, if available) 227 | # bar { 228 | # status_command i3status 229 | # } 230 | 231 | # Keyboard Layout 232 | exec_always --no-startup-id setxkbmap tr 233 | 234 | # Wallpaper 235 | exec_always --no-startup-id feh --bg-fill ~/Downloads/wp.jpg 236 | 237 | # Brightness 238 | bindsym XF86MonBrightnessUp exec xbacklight -inc 20 239 | bindsym XF86MonBrightnessDown exec xbacklight -dec 20 240 | 241 | # Picom 242 | exec_always --no-startup-id picom -f 243 | 244 | # Assign programs to workspaces 245 | # for_window [class="firefox"] move to workspace $ws3 246 | # for_window [class="Spotify"] move to workspace $ws2 247 | 248 | focus_follows_mouse no 249 | 250 | # Polybar launch script 251 | exec_always --no-startup-id $HOME/.config/polybar/launch.sh 252 | 253 | # exec_always --no-startup-id i3-sensible-terminal 254 | -------------------------------------------------------------------------------- /polybar/config: -------------------------------------------------------------------------------- 1 | ;========================================================== 2 | ; 3 | ; 4 | ; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗ 5 | ; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗ 6 | ; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝ 7 | ; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗ 8 | ; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║ 9 | ; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ 10 | ; 11 | ; 12 | ; To learn more about how to configure Polybar 13 | ; go to https://github.com/polybar/polybar 14 | ; 15 | ; The README contains a lot of information 16 | ; 17 | ;========================================================== 18 | 19 | [colors] 20 | ;background = ${xrdb:color0:#222} 21 | background = #664A6594 22 | background-alt = #66#4A6594 23 | ;foreground = ${xrdb:color7:#222} 24 | foreground = #FFFFFF 25 | foreground-alt = #ffffff 26 | primary = #ffb52a 27 | secondary = #ffffff 28 | alert = #bd2c40 29 | 30 | [bar/example] 31 | ;monitor = ${env:MONITOR:HDMI-1} 32 | width = 100% 33 | height = 27 34 | ;offset-x = 15% 35 | ;offset-y = 5% 36 | radius = 0.0 37 | fixed-center = false 38 | enable-ipc = true 39 | 40 | background = ${colors.background} 41 | foreground = ${colors.foreground} 42 | 43 | ;line-size = 2 44 | ;line-color = #f00 45 | 46 | border-size = 0 47 | border-color = #00000000 48 | 49 | padding-left = 2 50 | padding-right = 1 51 | 52 | module-margin = 4 53 | ;module-margin-left = 1 54 | ;module-margin-right = 3 55 | 56 | separator = %{F#A4A4A4}|%{F-} 57 | 58 | ;font-0 = MesloLGS NF:style=Bold:pixelsize=10; 59 | font-0 = SF Pro Display:style=Bold:pixelsize=10;2 60 | font-1 = Hack-Regular:pixelsize=10;2 61 | font-2 = Apple Color Emoji:fontformat=truetype:scale=10:antialias=false;2 62 | 63 | ;xwindow = Pencere adını 64 | ;xkeyboard = Klavye dili ve Capslock fonksiyonları 65 | 66 | modules-left = i3 spotify 67 | modules-right = gmail xbacklight pulseaudio wlan cpu memory battery temperature date powermenu 68 | 69 | tray-position = right 70 | tray-padding = 1 71 | ;tray-background = #0063ff 72 | 73 | ;wm-restack = bspwm 74 | ;wm-restack = i3 75 | 76 | ;override-redirect = true 77 | 78 | ;scroll-up = bspwm-desknext 79 | ;scroll-down = bspwm-deskprev 80 | 81 | scroll-up = i3wm-wsnext 82 | scroll-down = i3wm-wsprev 83 | 84 | cursor-click = pointer 85 | ;cursor-scroll = ns-resize 86 | 87 | [module/xwindow] 88 | type = internal/xwindow 89 | label = %title:0:30:...% 90 | 91 | [module/xkeyboard] 92 | type = internal/xkeyboard 93 | blacklist-0 = num lock 94 | 95 | ;format-prefix = " " 96 | ;format-prefix-foreground = ${colors.foreground-alt} 97 | ;format-prefix-underline = ${colors.secondary} 98 | 99 | label-layout = 100 | label-layout-underline = ${colors.secondary} 101 | 102 | label-indicator-padding = 2 103 | label-indicator-margin = 1 104 | label-indicator-background = #664A6594 105 | label-indicator-underline = ${colors.secondary} 106 | 107 | [module/filesystem] 108 | type = internal/fs 109 | interval = 25 110 | 111 | mount-0 = / 112 | 113 | label-mounted = %{F#0a81f5}%mountpoint%%{F-}: %percentage_used%% 114 | label-unmounted = %mountpoint% not mounted 115 | label-unmounted-foreground = ${colors.foreground-alt} 116 | 117 | [module/bspwm] 118 | type = internal/bspwm 119 | 120 | label-focused = %index% 121 | label-focused-background = ${colors.background-alt} 122 | label-focused-underline= ${colors.primary} 123 | label-focused-padding = 2 124 | 125 | label-occupied = %index% 126 | label-occupied-padding = 2 127 | 128 | label-urgent = %index%! 129 | label-urgent-background = ${colors.alert} 130 | label-urgent-padding = 2 131 | 132 | label-empty = %index% 133 | label-empty-foreground = ${colors.foreground-alt} 134 | label-empty-padding = 2 135 | 136 | ; Separator in between workspaces 137 | ; label-separator = | 138 | 139 | [module/i3] 140 | type = internal/i3 141 | format = 142 | index-sort = true 143 | wrapping-scroll = false 144 | 145 | ; Only show workspaces on the same output as the bar 146 | ;pin-workspaces = true 147 | 148 | label-mode-padding = 2 149 | label-mode-foreground = #000 150 | label-mode-background = ${colors.primary} 151 | 152 | ; focused = Active workspace on focused monitor 153 | label-focused = %index% 154 | label-focused-background = ${colors.background-alt} 155 | label-focused-underline= ${colors.primary} 156 | label-focused-padding = 2 157 | 158 | ; unfocused = Inactive workspace on any monitor 159 | label-unfocused = %index% 160 | label-unfocused-foreground = #969696 161 | label-unfocused-padding = 2 162 | 163 | ; visible = Active workspace on unfocused monitor 164 | label-visible = %index% 165 | label-visible-background = ${self.label-focused-background} 166 | label-visible-underline = ${self.label-focused-underline} 167 | label-visible-padding = ${self.label-focused-padding} 168 | 169 | ; urgent = Workspace with urgency hint set 170 | label-urgent = %index% 171 | label-urgent-background = ${colors.alert} 172 | label-urgent-padding = 2 173 | 174 | ; Separator in between workspaces 175 | ; label-separator = | 176 | 177 | [module/gmail] 178 | type = custom/script 179 | exec = ~/.config/polybar/gmail/launch.py 180 | tail = true 181 | click-left = xdg-open https://mail.google.com 182 | 183 | [module/mpd] 184 | type = internal/mpd 185 | format-online = 186 | 187 | icon-prev =  188 | icon-stop =  189 | icon-play =  190 | icon-pause =  191 | icon-next =  192 | 193 | label-song-maxlen = 25 194 | label-song-ellipsis = true 195 | 196 | [module/xbacklight] 197 | type = internal/xbacklight 198 | 199 | format-prefix = "💡 " 200 | format =