Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Maxime Bombar
Config_Files
Commits
84d68438
Commit
84d68438
authored
Sep 28, 2020
by
Maxime Bombar
Browse files
[i3/bin] Uncommitted stuff about new_workspace.py and venv
parent
f92a22eb
Changes
2
Hide whitespace changes
Inline
Side-by-side
.config/i3/bin/new_workspace.py
View file @
84d68438
...
...
@@ -4,19 +4,41 @@
import
i3ipc
from
argparse
import
ArgumentParser
import
logging
import
colorlog
logger
=
logging
.
getLogger
()
def
main
():
i3
=
i3ipc
.
Connection
()
workspaces
=
i3
.
get_workspaces
()
all_numbers
=
sorted
(
list
(
map
(
lambda
w
:
w
.
num
,
workspaces
)))
all_numbers
=
sorted
(
list
(
set
(
map
(
lambda
w
:
w
.
num
,
workspaces
))))
logger
.
info
(
f
"Current workspaces are
{
all_numbers
}
."
)
new
=
all_numbers
[
0
]
i
=
0
while
i
<
len
(
all_numbers
)
and
new
==
all_numbers
[
i
]:
while
i
<
len
(
all_numbers
)
and
(
all_numbers
[
i
]
<
0
or
new
==
all_numbers
[
i
]
)
:
new
+=
1
i
+=
1
logger
.
info
(
f
"i3-msg 'workspace
{
new
}
'"
)
i3
.
command
(
f
"workspace
{
new
}
"
)
if
__name__
==
'__main__'
:
if
__name__
==
"__main__"
:
format_string
=
"%(asctime)s - %(levelname)s - %(message)s"
stdout_handler
=
logging
.
StreamHandler
()
stdout_formatter
=
colorlog
.
ColoredFormatter
(
"%(log_color)s{}"
.
format
(
format_string
)
)
stdout_handler
.
setFormatter
(
stdout_formatter
)
logger
.
addHandler
(
stdout_handler
)
parser
=
ArgumentParser
()
parser
.
add_argument
(
"-v"
,
"--verbose"
,
help
=
"More logging."
,
action
=
"store_true"
)
args
=
parser
.
parse_args
()
if
args
.
verbose
:
logger
.
setLevel
(
logging
.
DEBUG
)
main
()
.config/i3/bin/venv.sh
View file @
84d68438
...
...
@@ -5,3 +5,5 @@ if [ ! -d ~/.config/i3/venv ]; then
source
~/.config/i3/venv/bin/activate
;
pip3
install
-r
~/.config/i3/requirements.txt
;
fi
source
~/.config/i3/venv/bin/activate
;
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment