Skip to content

Commit

Permalink
Tweak i3 visual settings & remove stuff I don't need
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinpinto committed Feb 27, 2024
1 parent 81c47dd commit 996c9ce
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 114 deletions.
48 changes: 0 additions & 48 deletions dotfiles/private_bin/private_executable_screen-recorder.tmpl

This file was deleted.

53 changes: 16 additions & 37 deletions dotfiles/private_dot_i3/config
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ bindsym $mod+a focus parent
bindsym $mod+Shift+a focus child

# Workspaces mapped to the secondary monitor
workspace "other" output DVI-I-1
workspace "other" output DP-3

# Workspaces mapped to the primary monitor
workspace "misc" output DP-0
Expand Down Expand Up @@ -123,24 +123,12 @@ exec_always --no-startup-id /usr/bin/xmodmap ~/.xmodmap
exec_always --no-startup-id /usr/bin/xrdb -load ~/.xresources
exec_always --no-startup-id /usr/bin/gnome-settings-daemon &
exec_always --no-startup-id /usr/bin/xset r rate 250 50
exec_always --no-startup-id xrandr --output DP-0 --primary --rotate normal --output DVI-I-1 --right-of DP-0 --rotate left --brightness 0.8
exec_always --no-startup-id xrandr --output DP-0 --primary --rotate normal --output DP-3 --left-of DP-0 --rotate right --brightness 0.8
exec_always --no-startup-id ~/.i3/startup-app.sh "/home/marvin/bin/stock-checker" "stock-checker"

# NOTE: Use the "xprop" utility to find window class name strings, ref: https://www.tuxtips.info/linux/how-to-find-applications-window-class-in-i3-window-manager
# WM_CLASS(STRING) = "<instance>", "<class>"

# Start plexamp and move it to the default scratchpad
exec_always --no-startup-id ~/.i3/startup-app.sh "plexamp" "plexamp"
for_window [class="Plexamp"] floating enable, border normal, move to scratchpad

# Ensure that the keybase window always stays in floating mode
exec_always --no-startup-id /usr/bin/run_keybase
for_window [class="Keybase"] floating enable, border normal, move to scratchpad

# Ensure that the slack window always stays in floating mode
exec_always --no-startup-id ~/.i3/startup-app.sh "slack" "slack"
for_window [class="Slack"] floating enable, border normal, move to scratchpad

# Start up a floating terminal & leave it in the scratchpad
exec_always --no-startup-id alacritty --class "scratch-terminal" --title "scratch terminal"
for_window [class="Alacritty" instance="scratch-terminal"] floating enable, border normal, move to scratchpad
Expand All @@ -149,23 +137,13 @@ for_window [class="Alacritty" instance="scratch-terminal"] floating enable, bord
exec_always --no-startup-id ~/.i3/startup-app.sh "1password --disable-gpu" "1password"
for_window [class="1Password" instance="1password"] floating enable, border normal, resize set 640 480, move to scratchpad

# Start discord and move it to the scratchpad
exec_always --no-startup-id ~/.i3/startup-app.sh "discord" "discord"
for_window [class="discord" instance="discord"] floating enable, border normal, move to scratchpad

# Always start gnome-calculator in floating mode
for_window [class="Gnome-calculator"] floating enable, border normal, resize set 640 480

# Scratchpad shortcuts
bindsym $mod+minus scratchpad show
bindsym $alt+t [class="Alacritty" instance="scratch-terminal"] scratchpad show
bindsym $alt+k [class="Keybase"] scratchpad show
bindsym $alt+s [class="Slack"] scratchpad show
bindsym $alt+p [class="1Password" instance="1password"] scratchpad show
bindsym $alt+d [class="discord" instance="discord"] scratchpad show

# alt+r to toggle screen recording
bindsym $alt+r exec bash ~/bin/screen-recorder

# Ensure that the following windows always start in floating mode
for_window [class="Pavucontrol"] floating enable, border normal
Expand Down Expand Up @@ -201,17 +179,18 @@ client.urgent $bg $bg $ia
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
status_command i3status -c ~/.i3/i3status.conf | ~/.i3/wrapper.py
font pango:FontAwesome 8, pango:Terminus 8

colors {
background $bg
statusline $fg
separator $hi
focused_workspace $gn $bg $ac
active_workspace $bg $bg $ia
inactive_workspace $bg $bg $ia
urgent_workspace $bg $bg $ia
binding_mode $rd $bg $ac
}
status_command i3status -c ~/.i3/i3status.conf | ~/.i3/wrapper.py
font pango:terminal-font 10

colors {
background $bg
statusline $fg
separator $hi
focused_workspace $gn $bg $ac
active_workspace $bg $bg $ia
inactive_workspace $bg $bg $ia
urgent_workspace $bg $bg $ia
binding_mode $rd $bg $ac
}
tray_output primary
}
20 changes: 3 additions & 17 deletions dotfiles/private_dot_i3/executable_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
backup_status_file = "%s/tmp/backup-timestamp.txt" % os.environ['HOME']
backup_pid_file = "%s/tmp/acd-backup-lockfile.txt" % os.environ['HOME']
do_not_disturb_file = "%s/.irssi/do_not_disturb.txt" % os.environ['HOME']
screencast_pid_file = "%s/tmp/screencast.pid" % os.environ['HOME']

def get_pid(name):
return check_output(["pidof", name]).strip()
Expand All @@ -57,15 +56,15 @@ def get_backup_status():
if os.path.isfile(backup_status_file):
last_backup_time = os.path.getmtime(backup_status_file)
elif os.path.isfile(backup_pid_file) and checkPidRunning(int(open(backup_pid_file, 'r').readlines()[0])):
backup_status['full_text'] = " Backups IN PROGRESS"
backup_status['full_text'] = "☁️ Backups IN PROGRESS"
backup_status['color'] = COLORS['DEGRADED']
return backup_status;
else:
backup_status['full_text'] = " Last Backup: ERROR"
backup_status['full_text'] = "☁️ Last Backup: ERROR"
backup_status['color'] = COLORS['BAD']
return backup_status

backup_str = " Last Backup: %s" % datetime.fromtimestamp(last_backup_time).strftime("%Y-%m-%d")
backup_str = "☁️ Last Backup: %s" % datetime.fromtimestamp(last_backup_time).strftime("%Y-%m-%d")
current_time = int(time.time())
backup_status['full_text'] = backup_str
backup_time_seconds = current_time - last_backup_time
Expand Down Expand Up @@ -106,18 +105,6 @@ def get_screensaver_running_status():
return screensaver
return None

def get_screencast_status():
""" Get the current screencast recording status. """
screencast_status = {
'name': 'screencast'
}

if os.path.isfile(screencast_pid_file) and checkPidRunning(int(open(screencast_pid_file, 'r').readlines()[0])):
screencast_status['full_text'] = "📺 Recording IN PROGRESS"
screencast_status['color'] = COLORS['DEGRADED']
return screencast_status;
return None


def print_line(message):
""" Non-buffered printing to stdout. """
Expand Down Expand Up @@ -155,5 +142,4 @@ def read_line():
j = json.loads(line)
j.insert(1, get_backup_status())
j.insert(2, get_screensaver_running_status())
j.insert(3, get_screencast_status())
print_line(prefix+json.dumps(j))
24 changes: 12 additions & 12 deletions dotfiles/private_dot_i3/i3status.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,33 @@ general {

order += "disk /"
order += "tztime utc"
order += "wireless wlp5s0"
order += "ethernet eth2"
order += "ethernet enp4s0"
order += "volume master"
order += "load"
order += "tztime local"

volume master {
format = " %volume"
format_muted = " (%volume)"
format = "🔊 %volume"
format_muted = "🔇 (%volume)"
device = "default"
mixer = "Master"
mixer_idx = 0
}

wireless wlp5s0 {
format_up = " %essid (%frequency) - %ip"
format_down = " down"
format_up = "🛜 %essid (%frequency) - %ip"
format_down = "🛜 down"
color_good = "#9f9f9f"
}

ethernet eth2 {
format_up = " %ip"
format_down = ""
ethernet enp4s0 {
format_up = "⚡️%ip"
format_down = "⚡️down"
color_good = "#9f9f9f"
}

tztime local {
format = "%Y-%m-%d-%a %H:%M:%S"
format = "📅 %Y-%m-%d-%a %H:%M:%S"
}

tztime utc {
Expand All @@ -49,9 +49,9 @@ tztime utc {
}

load {
format = " %1min"
format = "🖥️ %1min"
}

disk "/" {
format = " %avail"
format = "💾 %avail"
}

0 comments on commit 996c9ce

Please sign in to comment.