display, i3
This commit is contained in:
@ -10,7 +10,7 @@
|
||||
padding = 8
|
||||
horizontal_padding = 8
|
||||
frame_width = 1
|
||||
frame_color = "#6C901C"
|
||||
frame_color = "#8C552E"
|
||||
|
||||
# Define a color for the separator.
|
||||
# possible values are:
|
||||
@ -75,21 +75,21 @@
|
||||
[urgency_low]
|
||||
# IMPORTANT: colors have to be defined in quotation marks.
|
||||
# Otherwise the "#" and following would be interpreted as a comment.
|
||||
background = "#0c0d05"
|
||||
foreground = "#6C901C"
|
||||
background = "#0f0e09"
|
||||
foreground = "#8C552E"
|
||||
timeout = 5
|
||||
# Icon for notifications with low urgency, uncomment to enable
|
||||
#icon = /path/to/icon
|
||||
|
||||
[urgency_normal]
|
||||
background = "#0c0d05"
|
||||
foreground = "#6C901C"
|
||||
background = "#0f0e09"
|
||||
foreground = "#8C552E"
|
||||
timeout = 5
|
||||
|
||||
[urgency_critical]
|
||||
background = "#0c0d05"
|
||||
foreground = "#6C901C"
|
||||
frame_color = "#6C901C"
|
||||
background = "#0f0e09"
|
||||
foreground = "#8C552E"
|
||||
frame_color = "#8C552E"
|
||||
timeout = 0
|
||||
|
||||
# Every section that isn't one of the above is interpreted as a rules to
|
||||
|
@ -26,9 +26,47 @@ bindsym $mod+Shift+q kill
|
||||
|
||||
# start dmenu (a program launcher)
|
||||
bindsym $mod+d exec --no-startup-id rofi -show drun -theme themes/app-launcher
|
||||
bindsym $mod+i exec --no-startup-id rofi -show window
|
||||
bindsym $mod+i exec --no-startup-id rofi -show window -theme themes/app-launcher
|
||||
|
||||
set $workspacer ~/.config/i3/i3-workspacer.py
|
||||
|
||||
# go to new workspace blocks
|
||||
#bindsym $mod+Tab exec --no-startup-id $workspacer go -d up
|
||||
#bindsym $mod+m exec --no-startup-id $workspacer go -d down
|
||||
|
||||
# move to new workspace blocks
|
||||
#bindsym $mod+Shift+Tab exec --no-startup-id $workspacer move -d up
|
||||
#bindsym $mod+Shift+m exec --no-startup-id $workspacer move -d down
|
||||
|
||||
# switch to workspace
|
||||
bindsym $mod+grave exec --no-startup-id ~/.config/i3/i3-goto-workspace
|
||||
bindsym $mod+1 exec --no-startup-id $workspacer go -n 1
|
||||
bindsym $mod+2 exec --no-startup-id $workspacer go -n 2
|
||||
bindsym $mod+3 exec --no-startup-id $workspacer go -n 3
|
||||
bindsym $mod+4 exec --no-startup-id $workspacer go -n 4
|
||||
bindsym $mod+5 exec --no-startup-id $workspacer go -n 5
|
||||
bindsym $mod+6 exec --no-startup-id $workspacer go -n 6
|
||||
bindsym $mod+7 exec --no-startup-id $workspacer go -n 7
|
||||
bindsym $mod+8 exec --no-startup-id $workspacer go -n 8
|
||||
bindsym $mod+9 exec --no-startup-id $workspacer go -n 9
|
||||
bindsym $mod+0 exec --no-startup-id $workspacer go -n 10
|
||||
|
||||
# move focused container to workspace
|
||||
bindsym $mod+Shift+grave exec --no-startup-id ~/.config/i3/i3-moveto-workspace
|
||||
bindsym $mod+Shift+1 exec --no-startup-id $workspacer move -n 1
|
||||
bindsym $mod+Shift+2 exec --no-startup-id $workspacer move -n 2
|
||||
bindsym $mod+Shift+3 exec --no-startup-id $workspacer move -n 3
|
||||
bindsym $mod+Shift+4 exec --no-startup-id $workspacer move -n 4
|
||||
bindsym $mod+Shift+5 exec --no-startup-id $workspacer move -n 5
|
||||
bindsym $mod+Shift+6 exec --no-startup-id $workspacer move -n 6
|
||||
bindsym $mod+Shift+7 exec --no-startup-id $workspacer move -n 7
|
||||
bindsym $mod+Shift+8 exec --no-startup-id $workspacer move -n 8
|
||||
bindsym $mod+Shift+9 exec --no-startup-id $workspacer move -n 9
|
||||
bindsym $mod+Shift+0 exec --no-startup-id $workspacer move -n 10
|
||||
|
||||
# renaming workspace
|
||||
bindsym $mod+n exec --no-startup-id ~/.config/i3/i3-rename-workspace
|
||||
bindsym $mod+Shift+n exec --no-startup-id ~/.config/i3/i3-renumber-workspace
|
||||
# move focused window
|
||||
bindsym $mod+j move left
|
||||
bindsym $mod+k move down
|
||||
@ -74,30 +112,6 @@ set $ws8 "8"
|
||||
set $ws9 "9"
|
||||
set $ws10 "10"
|
||||
|
||||
# switch to workspace
|
||||
bindsym $mod+1 workspace $ws1
|
||||
bindsym $mod+2 workspace $ws2
|
||||
bindsym $mod+3 workspace $ws3
|
||||
bindsym $mod+4 workspace $ws4
|
||||
bindsym $mod+5 workspace $ws5
|
||||
bindsym $mod+6 workspace $ws6
|
||||
bindsym $mod+7 workspace $ws7
|
||||
bindsym $mod+8 workspace $ws8
|
||||
bindsym $mod+9 workspace $ws9
|
||||
bindsym $mod+0 workspace $ws10
|
||||
|
||||
# move focused container to workspace
|
||||
bindsym $mod+Shift+1 move container to workspace $ws1
|
||||
bindsym $mod+Shift+2 move container to workspace $ws2
|
||||
bindsym $mod+Shift+3 move container to workspace $ws3
|
||||
bindsym $mod+Shift+4 move container to workspace $ws4
|
||||
bindsym $mod+Shift+5 move container to workspace $ws5
|
||||
bindsym $mod+Shift+6 move container to workspace $ws6
|
||||
bindsym $mod+Shift+7 move container to workspace $ws7
|
||||
bindsym $mod+Shift+8 move container to workspace $ws8
|
||||
bindsym $mod+Shift+9 move container to workspace $ws9
|
||||
bindsym $mod+Shift+0 move container to workspace $ws10
|
||||
|
||||
# reload the configuration file
|
||||
bindsym $mod+Shift+c reload
|
||||
|
||||
@ -152,9 +166,10 @@ exec_always --no-startup-id $HOME/.config/polybar/launch.sh
|
||||
|
||||
exec --no-startup-id i3-msg 'exec $TERMINAL; workspace 2; exec firefox;'
|
||||
exec --no-startup-id feh --bg-scale ~/Wallpapers/seneca.jpg
|
||||
exec --no-startup-id xrandr --output HDMI1 --right-of eDP1
|
||||
exec --no-startup-id xset dpms 500
|
||||
exec --no-startup-id ~/bin/autoconfgure_display.sh
|
||||
#exec --no-startup-id xset dpms 500
|
||||
exec --no-startup-id nm-applet
|
||||
exec --no-startup-id pasystray
|
||||
exec --no-startup-id clipit
|
||||
exec --no-startup-id xautolock -time 10 -locker "betterlockscreen -l dim"
|
||||
exec --no-startup-id ~/bin/dunstwal
|
||||
@ -163,7 +178,8 @@ exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
|
||||
exec telegram-desktop
|
||||
exec mattermost-desktop
|
||||
|
||||
exec --no-startup-id sleep 4; i3-msg '[class="Mattermost"] move scratchpad; [class="Telegram"] move scratchpad'
|
||||
exec --no-startup-id sleep 4; i3-msg '[class="Telegram"] move scratchpad'
|
||||
exec --no-startup-id sleep 4; i3-msg '[class="Mattermost"] move scratchpad'
|
||||
|
||||
exec_always --no-startup-id wal -R -n
|
||||
|
||||
@ -187,10 +203,11 @@ bindsym Mod1+Tab workspace back_and_forth
|
||||
bindsym $mod+Tab focus right
|
||||
bindsym $mod+Ctrl+Tab focus left
|
||||
bindsym Print exec "~/bin/screenshot.sh"
|
||||
bindsym $mod+Print exec "owo -s --fullscreen --no-cursor"
|
||||
#bindsym $mod+Print exec "owo -sq --fullscreen --no-cursor"
|
||||
|
||||
bindsym $mod+minus [class="Telegram"] scratchpad show
|
||||
bindsym $mod+p [class="Mattermost"] scratchpad show
|
||||
bindsym $mod+m [class="Cantata"] scratchpad show
|
||||
|
||||
bindsym $mod+Delete exec rofi -modi system:$HOME/.config/rofi/scripts/powermenu.sh -show system -theme themes/system-menu
|
||||
bindsym $mod+shift+Delete exec betterlockscreen -l
|
||||
|
2
.config/i3/i3-goto-workspace
Executable file
2
.config/i3/i3-goto-workspace
Executable file
@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
i3-input -f "-xos4-terminus-*-*-*-*-16-*-*-*-*-*-*-*" -F "exec --no-startup-id ~/.config/i3/i3-workspacer.py go --exact --number \"%s\"" -P 'Go To Workspace Number: '
|
2
.config/i3/i3-moveto-workspace
Executable file
2
.config/i3/i3-moveto-workspace
Executable file
@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
i3-input -f "-xos4-terminus-*-*-*-*-16-*-*-*-*-*-*-*" -F "exec --no-startup-id ~/.config/i3/i3-workspacer.py move --exact --number \"%s\"" -P 'Move To Workspace Number: '
|
2
.config/i3/i3-rename-workspace
Executable file
2
.config/i3/i3-rename-workspace
Executable file
@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
i3-input -f "-xos4-terminus-*-*-*-*-16-*-*-*-*-*-*-*" -F "exec --no-startup-id ~/.config/i3/i3-workspacer.py rename --name \"%s\"" -P 'Workspace Name: '
|
2
.config/i3/i3-renumber-workspace
Executable file
2
.config/i3/i3-renumber-workspace
Executable file
@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
i3-input -f "-xos4-terminus-*-*-*-*-16-*-*-*-*-*-*-*" -F "exec --no-startup-id ~/.config/i3/i3-workspacer.py rename --number \"%s\"" -P 'Workspace Number: '
|
148
.config/i3/i3-workspacer.py
Executable file
148
.config/i3/i3-workspacer.py
Executable file
@ -0,0 +1,148 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import i3ipc # Required for interactions with i3 and its IPC interface
|
||||
import sys # Required for exiting
|
||||
import math # Required for rounding
|
||||
import argparse # Required for easy arguments to command
|
||||
|
||||
VERSION = (1, 0)
|
||||
|
||||
i3 = i3ipc.Connection()
|
||||
|
||||
|
||||
def go_to_workspace(workspace_number):
|
||||
if workspace_number <= 0:
|
||||
workspace_number = 1
|
||||
i3_command = 'workspace number %s' % (workspace_number)
|
||||
print('i3 Command: %s' % i3_command)
|
||||
i3.command(i3_command)
|
||||
|
||||
|
||||
def move_to_workspace(workspace_number):
|
||||
if workspace_number <= 0:
|
||||
print('Not doing anything to a negative workspace')
|
||||
return 1
|
||||
i3_command = 'move container to workspace number %s' % (workspace_number)
|
||||
print('i3 Command: %s' % i3_command)
|
||||
i3.command(i3_command)
|
||||
|
||||
|
||||
def rename_workspace(workspace_name):
|
||||
i3_command = 'rename workspace to "%s"' % (workspace_name)
|
||||
print('i3 Command: %s' % i3_command)
|
||||
i3.command(i3_command)
|
||||
|
||||
|
||||
def get_workspace_number_and_name(workspace_name):
|
||||
try:
|
||||
if ': ' in workspace_name:
|
||||
workspace_number, workspace_name = workspace_name.split(': ')
|
||||
else:
|
||||
workspace_number = workspace_name
|
||||
workspace_number = int(workspace_number)
|
||||
except ValueError:
|
||||
print("Unable to parse Workspace's number and name")
|
||||
return (1, workspace_name)
|
||||
return (workspace_number, workspace_name)
|
||||
|
||||
|
||||
def make_workspace_name(workspace_number, workspace_name):
|
||||
return ': '.join([str(workspace_number), workspace_name])
|
||||
|
||||
|
||||
def get_workspace_block(workspace_number):
|
||||
return int(math.floor((workspace_number-1)/10))*10
|
||||
|
||||
|
||||
def shift_workspace_number(workspace_number, direction, number, exact):
|
||||
if direction is not None:
|
||||
if direction == 'up':
|
||||
workspace_number += 10
|
||||
elif direction == 'down':
|
||||
workspace_number -= 10
|
||||
elif direction == 'next':
|
||||
workspace_number += 1
|
||||
elif direction == 'prev':
|
||||
workspace_number -= 1
|
||||
elif number is not None:
|
||||
if exact is True:
|
||||
workspace_number = number
|
||||
else:
|
||||
workspace_block = get_workspace_block(workspace_number)
|
||||
workspace_number_in_block = number
|
||||
workspace_number = workspace_block + workspace_number_in_block
|
||||
return workspace_number
|
||||
|
||||
|
||||
def action_go(workspace_number, workspace_name, args):
|
||||
workspace_number = shift_workspace_number(workspace_number, args.direction, args.number, args.exact)
|
||||
go_to_workspace(workspace_number)
|
||||
|
||||
|
||||
def action_move(workspace_number, workspace_name, args):
|
||||
workspace_number = shift_workspace_number(workspace_number, args.direction, args.number, args.exact)
|
||||
return move_to_workspace(workspace_number)
|
||||
|
||||
|
||||
def action_rename(workspace_number, workspace_name, args):
|
||||
if args.number is not None:
|
||||
workspace_number = args.number
|
||||
if args.name is not None:
|
||||
workspace_name = args.name
|
||||
rename_workspace(make_workspace_name(workspace_number, workspace_name))
|
||||
|
||||
|
||||
def parse_args():
|
||||
parser = argparse.ArgumentParser(description='simplifying large amounts of i3 workspaces')
|
||||
parser.set_defaults(action=None)
|
||||
parser.add_argument('--version', action='version', version="%(prog)s {}.{}".format(*VERSION))
|
||||
|
||||
subparsers = parser.add_subparsers(help='check help for each command for required arguments')
|
||||
|
||||
parser_go = subparsers.add_parser('go', help="like the 'workspace number' command")
|
||||
parser_go.set_defaults(action=action_go)
|
||||
parser_go.add_argument('--exact', action='store_true',
|
||||
help="number arguments will be the actual workspace number instead of the index in the current block")
|
||||
group_go = parser_go.add_mutually_exclusive_group(required=True)
|
||||
group_go.add_argument('-d', '--direction', choices=['up', 'down', 'next', 'prev'],
|
||||
help='operate relative to the current workspace; up/down = +/- 10')
|
||||
group_go.add_argument('-n', '--number', type=int,
|
||||
help='specify workspace number')
|
||||
|
||||
parser_move = subparsers.add_parser('move', help="like the 'move container to workspace number' command")
|
||||
parser_move.set_defaults(action=action_move)
|
||||
parser_move.add_argument('--exact', action='store_true',
|
||||
help="number arguments will be the actual workspace number instead of the index in the current block")
|
||||
group_move = parser_move.add_mutually_exclusive_group(required=True)
|
||||
group_move.add_argument('-d', '--direction', choices=['up', 'down', 'next', 'prev'],
|
||||
help='operate relative to the current workspace; up/down = +/- 10')
|
||||
group_move.add_argument('-n', '--number', type=int,
|
||||
help='specify workspace number')
|
||||
|
||||
parser_rename = subparsers.add_parser('rename', help="like the 'rename workspace to' command")
|
||||
parser_rename.set_defaults(action=action_rename)
|
||||
parser_rename.add_argument('-na', '--name',
|
||||
help='change the name of the current workspace')
|
||||
parser_rename.add_argument('-nu', '--number', type=int,
|
||||
help='change the number of the current workspace')
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.action is None:
|
||||
parser.print_help()
|
||||
return
|
||||
|
||||
return args
|
||||
|
||||
|
||||
def main():
|
||||
args = parse_args()
|
||||
|
||||
workspace_name = i3.get_tree().find_focused().workspace().name
|
||||
workspace_number, workspace_name = get_workspace_number_and_name(workspace_name)
|
||||
|
||||
sys.exit(args.action(workspace_number, workspace_name, args))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
@ -330,7 +330,7 @@ icon-prev = 玲
|
||||
icon-next = 怜
|
||||
|
||||
|
||||
label-song-maxlen = 25
|
||||
label-song-maxlen = 60
|
||||
label-song-ellipsis = true
|
||||
|
||||
[module/xbacklight]
|
||||
@ -577,7 +577,7 @@ label-warn-padding = 1
|
||||
format-warn = <ramp> <label-warn>
|
||||
;format-warn-underline = ${self.format-underline}
|
||||
format-warn-background= ${colors.primary}
|
||||
hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon6/temp1_input
|
||||
hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon5/temp1_input
|
||||
label = %temperature-c%
|
||||
label-warn = %temperature-c%
|
||||
label-warn-foreground = ${colors.background}
|
||||
|
Reference in New Issue
Block a user