Chrome: Strange Tiling Behavior - xmonad

sorry for being a n00b with Haskell, but every time I open Chromium on my XMonad Arch Linux machine I get this weird side window with chromium's underlying data.
Look at the image here if it helps:
I want, when opening chromium, to not show this strange side window. I do not care if chromium is floating or full screen or anything, I just want this weird window gone!
Sorry for being new to xmonad!!
Here is a snippet from my xmonad.hs file:
import XMonad.Hooks.ManageHelpers (composeOne, isFullscreen, isDialog, doFullFloat, doCenterFloat)
myManageHook = composeAll. concat $
[ [ className =? c --> doCenterFloat| c <- floats]
, [ resource =? r --> doIgnore | r <- ignore]
, [ resource =? "gecko" --> doF (W.shift "net") ]
, [ isFullscreen --> doFullFloat]
, [ isDialog --> doCenterFloat]]
where floats = ["chromium", "Vlc"]
ignore = []

Instead of calling Chromium from the command line you could install dmenu and call it via dmenu. The reason for the underlying data is that you start it via the terminal, so the terminal will stay there because it's kinda "hosting" the process of Chromium.
Import Dmenu in your xmonad configuration:
import XMonad.Util.Dmenu
And install the package dmenu.
You can then call it with your mod Key and "P" or define a key mapping in your config. In my case I press "Windows"-Key and "P" and then dmenu opens and I type "Chromium".

Related

Python Black Formatter - stop working with "color = true" in pyproject.toml

I have an issue with Black Python formatter in VSCode.
It works perfectly with the VSCode parameters and now I work on a shared repository with a pyproject.toml configuration file.
This file includes a few configs for Black so we all share the same code formatting.
But on this repo, Black does not format anything for me anymore.
This is what the Black config part look like
[tool.black]
# https://github.com/psf/black
target-version = ["py39"]
color = false
line-length = 120
exclude = '''
/(
\.git
| \.mypy_cache
| \.tox
| \.venv
| build
| venv
)/
'''
What is really weird to me is that the single line that seems to be the issue is color = true.
If I remove it or even do color = false, it works fine.
But I don't want to change a parameter for everyone on the repo because it fails on my computer...
Does anyone have any idea?
P.S: I am on Windows, could it be the reason? And if so, is there anything I can do about it?

New to django, my terminal thinks that there is a syntax error with "path"

path('details/<int:pk>/', ArticleDetailView.as_view(), name="article_details"),
my terminal thinks that there is syntax error here, specifically an arrow that points to the 'h' in 'path' i am running ubuntu 18.04 on a jetson nano, and this is in urls.py.
terminal page after python3 manage.py runserver
Check whether you import path from django URLs
which is:
from django.urls import path
If you've already imported it. Check if you separate each URL's by a comma at the end of the line
urlpatterns = [
path('details/<int:pk>/', ArticleDetailView.as_view(), name="article_details"),
path('login/', UserLoginView.as_view(), name="login"),
]

Autoformatting failed, buffer not changed : Sublime text

While setting up Python Development Environment in Sublime text 3, I wanted Auto formatting on and hence I made the following settings in Preferences > Package settings > Anaconda > Settings User
{
"auto_formatting": true,
"autoformat_ignore":
[
],
"pep8_ignore":
[
"E501"
],
"anaconda_linter_underlines": false,
"anaconda_linter_mark_style": "none",
"display_signatures": false,
"disable_anaconda_completion": true,
"python_interpreter": "/usr/local/bin/python3"
}
The auto_formatting value is set to true in user settings and it is set to false in default settings .
The auto formatting does not work out and gives me Autoformatting failed, buffer not changed error . Also tried changing auto_formatting_timeout = 5 //seconds , but that didn't work out . It would be of great help if someone could help me out .
I had the exact same issue. The problem is the last line is pointing to the wrong path for your python interpreter
Preferences > Package Settings > Anaconda > Settings - User
Delete the last line
"python_interpreter": "/usr/local/bin/python3"
Replace it with
"python_interpreter": "C:\\Users\\YOUR_NAME\\AppData\\Local\\Programs\\Python\\Python38-32\\python.EXE"
IMPORTANT: Your python interpreter path might be different to mine so find out where it is. Remember you need to use TWO backslashes in the path not ONE
Sublime is looking for python in environmental variable when you build it, and it is not able to find it there. You can test it in cmd by typing python and if it opens Microsoft store then here is the fix you can do, it worked for me. Open setting -> search for manage app execution aliases -> turn off "python.exe" and "python3.exe". Now check if you can get python in cmd by typing python, if you do then sublime problem should be fixed. If you want to know why this works follow this stack overflow

Pharo Metalink not works on #ifTrue: send node

When I add MetaLink to all send nodes in the following code, the Metalink on #ifTrue: not works:
aMethod
10 = 11
ifTrue: [ ^ 3 ]
code to add MetaLinks:
ast sendNodes do: [ :n |
n link: (MetaLink new
metaObject: [ :node |
Transcript show: node asString; cr ];
arguments: #(node);
selector: #value:;
control: #before;
yourself) ]
Can anyone explain why this happens?
How can I add a MetaLink on a #ifTrue: send?
Thanks to the comment from # LeandroCaniglia, this is because of compile optimization.
You can uncheck Inline If in Opal Compiler settings and recompile the method.
After recompile, reinstall your Metalinks and you will see #ifTrue: as a message call.

How do I include this directory in the $PATH env var?

I'm building a package for Github's Atom editor and Im running into a challenge trying to get a child process to execute with node js. I'm pretty sure that the problem is that the environment that Atom runs in, doesn't include the path to the mrt script. So when I run this from within my package:
exec = require("child_process").exec
child = undefined
child = exec("/usr/local/bin/mrt add iron-router", { cwd: path },(error, stdout, stderr) -
console.log "stdout: " + stdout
console.log "stderr: " + stderr
console.log "exec error: " + error if error isnt null
return
)
in the console, I get:
Atom has a web inspector built right into it and you can actually see the Paths that atom has included. So when I go to Atom's console and type: process.env.PATH it shows the paths: /usr/bin:/bin:/usr/sbin:/sbin. So I somehow need to make atom aware of that mrt script's path. Anyone know how I might go about doing that?
I also reached out on on Atom's discussion forum yesterday, but have yet to come up with a solution.
Edit:
I should also note that the normal command for excuting the mrt package installer is mrt add package-name but as advised on Atom's discussion forum, I've been using the full path.
Edit 2:
I've creating symlinks to node in my /usr/bin directory, and it's working now. Now I'm trying to get node to create the symlinks for me using fs.symlink but that doesn't seem to be working.
To sum it up, the problem is that Atom uses PATH from where it is launched. Consequently, the path to node and the path to mrt where not included in Atom's path. The solution came to me when someone on the Atom Discussion forum pointed out Atom's Class BufferedNodeProcess.
At the time of Answer there is a slight bug with that class so I was not able to use it - the Github team works fast, I wouldn't be surprised if it was fixed within the next couple days. I was, however, able use some of the code to get Atom's environments. Also, I ended up using node's spawn method instead of execute since that's what BufferedNodeProcess uses. Plus you can read each individual line of the stdout.
options =
cwd: atom.project.getPath()
options.env = Object.create(process.env) unless options.env?
options.env["ATOM_SHELL_INTERNAL_RUN_AS_NODE"] = 1
node = (if process.platform is "darwin" then path.resolve(process.resourcesPath, "..", "Frameworks", "Atom Helper.app", "Contents", "MacOS", "Atom Helper") else process.execPath)
mrt = spawn(node, [
"/usr/local/lib/node_modules/meteorite/bin/mrt.js"
"add"
"iron-router"
], options )
mrt.stdout.on "data", (data) ->
console.log "stdout: " + data
return
mrt.stderr.on "data", (data) ->
console.log "stderr: " + data
return
mrt.on "close", (code) ->
console.log "child process exited with code " + code
return

Resources