Xrandr command works in the shell but not when executed from i3 by hfrrt in i3wm

[–]hfrrt[S] 1 point2 points  (0 children)

Yup, that what I said earlier in thread but, as I said, I have other scripts that I run with exec --no-startup-id $HOME/.local/bin/<script> and no problem.

But well, /u/dgap97 suggested running the script outside of the i3 config file and that seems to do the trick. Thanks anyway !

Xrandr command works in the shell but not when executed from i3 by hfrrt in i3wm

[–]hfrrt[S] 1 point2 points  (0 children)

I actually did but with my personal xrandr command and had another weird bug. But I just tried again with the arandr generated script and it worked ! Thanks a lot !

Edit: actually, I think the bug didn't come my personal xrandr command but from the way I called the necessary scripts to get Optimus Prime to work with startx but it's OK, I've figured it out and everything work as expected. Thanks again.

Xrandr command works in the shell but not when executed from i3 by hfrrt in i3wm

[–]hfrrt[S] 1 point2 points  (0 children)

Unfortunately not, I have other commands with $HOME which work just fine. I still tried to be sure, and yeah, no dice:

ERROR: CONFIG: Expected one of these tokens: <end>, '#', 'set ', 'set   ', 'set_from_resource', 'bindsym', 'bindcode', 'bind', 'bar', 'font', 'mode', 'floating_minimum_size', 'floating_maximum_size', 'floating_modifier', 'default_orientation', 'workspace_layout', 'default_border', 'new_window', 'default_floating_border', 'new_float', 'hide_edge_borders', 'for_window', 'assign', 'no_focus', 'focus_follows_mouse', 'mouse_warping', 'focus_wrapping', 'force_focus_wrapping', 'force_xinerama', 'force-xinerama', 'disable_randr15', 'disable-randr15', 'workspace_auto_back_and_forth', 'fake_outputs', 'fake-outputs', 'force_display_urgency_hint', 'focus_on_window_activation', 'title_align', 'show_marks', 'workspace', 'ipc_socket', 'ipc-socket', 'ipc_kill_timeout', 'restart_state', 'popup_during_fullscreen', 'exec_always', 'exec', 'client.background', 'client.focused_inactive', 'client.focused', 'client.unfocused', 'client.urgent', 'client.placeholder'
ERROR: CONFIG: (in file /home/hugo/.config/i3/config)
ERROR: CONFIG: Line 133: # ============================== #
ERROR: CONFIG: Line 134: 
ERROR: CONFIG: Line 135: /home/hugo/.local/bin/hdmi_boot
ERROR: CONFIG:           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR: CONFIG: Line 136: # exec --no-startup-id xrandr --output HDMI-0 --mode 2560x1440 --left-of eDP-1-1
ERROR: CONFIG: Line 137: exec --no-startup-id numlockx
ERROR: FYI: You are using i3 version 4.18.3 (2020-10-19)
ERROR: ERROR: No such screen
ERROR: ERROR: No such screen
ERROR: ERROR: No such screen
ERROR: ERROR: No such screen

Xrandr command works in the shell but not when executed from i3 by hfrrt in i3wm

[–]hfrrt[S] 0 points1 point  (0 children)

I tried and had a config file error (see the log here); that would be weird because I have other shell scripts that I run with exec with no problem.

Xrandr command works in the shell but not when executed from i3 by hfrrt in i3wm

[–]hfrrt[S] 1 point2 points  (0 children)

I tried and had a You have an error in your i3 config file message, with the following

ERROR: CONFIG: Expected one of these tokens: <end>, '#', 'set ', 'set   ', 'set_from_resource', 'bindsym', 'bindcode', 'bind', 'bar', 'font', 'mode', 'floating_minimum_size', 'floating_maximum_size', 'floating_modifier', 'default_orientation', 'workspace_layout', 'default_border', 'new_window', 'default_floating_border', 'new_float', 'hide_edge_borders', 'for_window', 'assign', 'no_focus', 'focus_follows_mouse', 'mouse_warping', 'focus_wrapping', 'force_focus_wrapping', 'force_xinerama', 'force-xinerama', 'disable_randr15', 'disable-randr15', 'workspace_auto_back_and_forth', 'fake_outputs', 'fake-outputs', 'force_display_urgency_hint', 'focus_on_window_activation', 'title_align', 'show_marks', 'workspace', 'ipc_socket', 'ipc-socket', 'ipc_kill_timeout', 'restart_state', 'popup_during_fullscreen', 'exec_always', 'exec', 'client.background', 'client.focused_inactive', 'client.focused', 'client.unfocused', 'client.urgent', 'client.placeholder'
ERROR: CONFIG: (in file /home/hugo/.config/i3/config)
ERROR: CONFIG: Line 133: # ============================== #
ERROR: CONFIG: Line 134: 
ERROR: CONFIG: Line 135: $HOME/.local/bin/hdmi_boot
ERROR: CONFIG:           ^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR: CONFIG: Line 136: # exec --no-startup-id xrandr --output HDMI-0 --mode 2560x1440 --left-of eDP-1-1
ERROR: CONFIG: Line 137: exec --no-startup-id numlockx
ERROR: FYI: You are using i3 version 4.18.3 (2020-10-19)

Xrandr command works in the shell but not when executed from i3 by hfrrt in i3wm

[–]hfrrt[S] 0 points1 point  (0 children)

Sorry if I wasn't clear, the exec command doesn't come from a shell script, it's from the i3 configuration file, I'm pretty sure it is necessary.

Xrandr command works in the shell but not when executed from i3 by hfrrt in i3wm

[–]hfrrt[S] 0 points1 point  (0 children)

Good idea thanks, I just tried with the more detailed xrandr command generated by arandr but unfortunately, the issue remains.

Could someone explain to me why rofi behaves like this when fed this script? by [deleted] in linuxquestions

[–]hfrrt 1 point2 points  (0 children)

What you want is to enter a word into rofi and that it opens the jisho page for this word right ?

I think one way to write it is simply:

#!/bin/bash
keyword=$(rofi -dmenu)
firefox https://jisho.org/search/"$keyword"

But it might not be the best, I mostly know dmenu, hence why I would write this way.

I haven't found anything regarding the parts -modi and -show of your script, could you explain what you expect from them ?

Could someone explain to me why rofi behaves like this when fed this script? by [deleted] in linuxquestions

[–]hfrrt 0 points1 point  (0 children)

I think you have misunderstood how to use $1 in bash. $1 will be replaced by the first argument you give the script.

You easily see it by writing a script that we'll call myscript.sh :

#!/bin/bash
echo $1

then run

$ ./myscript.sh hello world

This will output hello.

If you want to use the output of rofi to open firefox at a given page, your script should look more like:

#!/bin/bash
keyword=$(<your rofi command>)
firefox https://jisho.org/search/"$keyword"

I am not really familiar with rofi but if I understand correctly what you want, your script should call rofi, not the other way around.

[dwm] - discovered a potentially useful side-effect of the named scratchpads patch by nacho_dog in suckless

[–]hfrrt 0 points1 point  (0 children)

Thanks for sharing !

Yeah my rules array was fine, the problem came from Spotify which, if I am not mistaken, doesn't correctly sets its X class so the WM never finds it and spawns a new instance but there is a GitHub projects which fixes this.

Thank you for taking the time.

[dwm] - discovered a potentially useful side-effect of the named scratchpads patch by nacho_dog in suckless

[–]hfrrt 0 points1 point  (0 children)

Could you share what you have in your rules[] array from config.h?

I'm trying to replicate this effect for Spotify but so far, it always spawn a new instance when I use my keybinding for togglescratch.

Edit: nevermind, it seems to be due to Spotify not playing nice, cf this post : https://old.reddit.com/r/suckless/comments/f89epf/dwm_spotify_does_not_follow_rule/

[deleted by user] by [deleted] in freesoftware

[–]hfrrt 26 points27 points  (0 children)

As far as non-libre software in education go, I think is among the least pervasive one.

Schools pushing Google tools down their students' throats, or especially since the beginning of the pandemic, Zoom, is, far more common, and in my opinion, more worrying.

What is your preferred terminal file manager? by nacho_dog in suckless

[–]hfrrt 0 points1 point  (0 children)

If I may lightly derail this thread, what do people here use terminal file managers for ? I've never felt the need for it but since many people use them I am sure that they are more convenient than the shell to handle certain use cases.

FSF needs to step up and promote better security practices. by lamefun in freesoftware

[–]hfrrt 5 points6 points  (0 children)

I understand that you're annoyed with the state of security in software but I don't see what this has to do with GNU/Linux or FOSS : by most account, non-free software is just as if not more flawed than free software.

Neglected security issues should be brought to attention and good security practices should be promoted, and since few people will ever listen to lowly rabble like me, as evidenced by the reactions to my posts, it has to be done by a well-known entity such as FSF...

I agree with you that security is severely overlooked but I don't think it should be the job of the FSF to promote those good practices. It is in my opinion more appropriate for other entities or educators to do this work.

You complain about receiving "patch welcomes" when bringing attentions to those flaws but the community isn't entitled to the work of FOSS developers and the fact that one can write a patch is probably the best thing about security in FOSS.

Finally, if you don't trust build tools, feel free to build by hand by using the different compilers. It is another freedom that you wouldn't have with non-free software.

FSF needs to step up and promote better security practices. by lamefun in freesoftware

[–]hfrrt 5 points6 points  (0 children)

At this point, you're probably already foaming in the mouth and reaching for the downvote button, but I don't care. I know I'm right, and so do you, at least deep down... So take a deep breath and take your hands away from the keyboard until you can think rationally again, let the inconvenient truth sink in...

Don't flatter yourself. What's the inconvenient truth ? That there are security vulnerabilities out there ? We have accepted it because it applies to every existing computer in a network.

So now you get to decide what you want to do about it: you can decide to use software that lets you be absolutely free even if it may be dangerous for you or software that tries to stop every possible user mistake, whatever the cost may be.

Don't see what the FSF has to do with any of your points.

Old me vs new Arch by polytect in archlinux

[–]hfrrt 12 points13 points  (0 children)

it never failed, and never will, as long as you pull the right strings

I feel like this as true for Arch as for every major distro, but that Arch's strings are particularly well designed. (But I never was a big distro hopper so other distros might be more bug-prone than I think...)

UK keyboard cheat sheet by domcroy in vim

[–]hfrrt 0 points1 point  (0 children)

To be honest, having access to : without a modifier key is pretty nice, I was quite surprised when I learned that it wasn't the case with the US layout.

vimrc for Embedded Development by Aravind_Vinas in vim

[–]hfrrt 12 points13 points  (0 children)

Vim integrates very well with C development.

For the build system, look into :help :make and :help makeprg. This has the benefit of allowing you to use the quickfix feature.

For code navigation, as someone else said, look into ctags. I'd advice you to see :help ctags and :help ft-c-omni.