From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id KKv5LZpTPWMCdgAAbAwnHQ (envelope-from ) for ; Wed, 05 Oct 2022 11:51:22 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id GB0lLZpTPWP6VQAAG6o9tA (envelope-from ) for ; Wed, 05 Oct 2022 11:51:22 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 780AF27378 for ; Wed, 5 Oct 2022 11:51:22 +0200 (CEST) Received: from localhost ([::1]:55756 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1og13h-0000ks-3i for larch@yhetil.org; Wed, 05 Oct 2022 05:51:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36586) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1og11M-0000jf-G6 for help-guix@gnu.org; Wed, 05 Oct 2022 05:48:56 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:56697) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1og11J-0002Ce-Kh for help-guix@gnu.org; Wed, 05 Oct 2022 05:48:56 -0400 Received: (Authenticated sender: jordila@librebits.info) by mail.gandi.net (Postfix) with ESMTPSA id 6D770240006 for ; Wed, 5 Oct 2022 09:48:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=librebits.info; s=gm1; t=1664963324; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=nBPR6l7Els5++huDOfiFrtpp+TlKK8hMXqi869bVf+M=; b=P3SaYftE5/RnChgnUHkR5Cdn4P5orMS9Eh8j/VVQXd7meJleMYqlz3whozClg8dvJtEphi mqfghTRfMZDxRDBNjs7jqAYm7QmIQP/+fyWKGWnuyAMVSNpVdNePN35pph1QaInoisI/Rr gSkWo565Muno3Q5FJuCn0H4F9bibnYhIDz6tVbaa1SiRbx+fdlGQRhCoDWslYDMnWks71l vhRqOFCGBsdpsUkFxZxvTh5bsUtVooechswlohqAtgVdCdo6X0/qI4PVwDVHClVUcIj9Il JxJ8PoXO9GbR8np4RKJI3k2e7v/7iqssqudzC8N9onFhMZea37EjLTye258csA== Date: Wed, 5 Oct 2022 11:48:42 +0200 From: jordi To: help-guix@gnu.org Subject: Re: bash scripts in Guix question - suspend ? Message-ID: References: <871qrnk61s.fsf@laura> <871qrnj5wu.fsf@gmail.com> <877d1eapma.fsf@laura> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <877d1eapma.fsf@laura> Received-SPF: pass client-ip=217.70.183.193; envelope-from=jordila@librebits.info; helo=relay1-d.mail.gandi.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1664963482; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=nBPR6l7Els5++huDOfiFrtpp+TlKK8hMXqi869bVf+M=; b=GtD5b+dXLpZ+Vvo/aQSquNWNMvRpEYiJ4M0XjEH5hSTA4NkyH/ikncuk9HsgOrq23sAXaY IqSIqI4OetHzpYv8oC3cCeLdH3T+xTdyV7aqShWPkLi6UtY+tPQm6jb1FKle/IQSMHd/rF kSz1YEdUJjaLXktB96aJqCNtaU2LDdExM94eFu1bKEsr7dG/kKub7+qpSNwH5HF8fsdZT3 Ka1KPo/2rTdLaPBk+KOBG/T+SGkNdWvCRPipTdv8wA3yC7jqiQ4uUN2KQ660VVSq7aXAkU P5oYRKGfYWCfDuUtJBg5oxmfAZgxFpRcQqIi1GsO4jywWV/4pZOAcr+lEI+2ew== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1664963482; a=rsa-sha256; cv=none; b=XJDEHI0eE6p2LJ8NFgNeuQFujvF/UAHyOA0NAgMTj/wBWhUaAxvt8oLR+61Q2mIz1EfEaO etKdU1tOaXo6ogme9kh9L61uvYjxAv8ZyqMB0kVtaAJa7DwGWNwlnCdyzlL9/UOdzUFW5Y DDx5XwlSb6uxjiLE41rH6OvJR0ZQid0tdJeDYXfw3ki+DTJ1TMRLfRNPryE4GmS0IFz0cq JiZ8FYZYSPusGPjBNcychrs72/N9GBuGZc0p6FjncIfE6Blal9zYD1gpDY+C2OY0zg3i44 77UZ8MwnBL3EOq4X5NC3cG9+HWzko93gfM/hsvGy9bAF7U/eYiIvE7V09OMomw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=librebits.info header.s=gm1 header.b=P3SaYftE; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.16 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=librebits.info header.s=gm1 header.b=P3SaYftE; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 780AF27378 X-Spam-Score: -2.16 X-Migadu-Scanner: scn0.migadu.com X-TUID: +TmvhI1U85jd Thank you all for your warm welcome and answers to my questions. I'm trying to adapt this script [..] Suspend) ~/.config/i3/i3exit suspend [..] to my new Guix environment, in my first iteration, [..] Suspend) ~/.config/i3/i3exit loginctl suspend [..] replacing prepending loginctl leads to unsuccesful results, for now. I'm puzzled, as long as 'loginctl suspend' is working in the shell , What am i missing ? Thanks, thanks, thanks On 2022-10-04 23:58:05, Olivier Dion via wrote: > On Tue, 04 Oct 2022, Maxim Cournoyer wrote: > > Hi, > > > > Olivier Dion via writes: > > > >> On Tue, 04 Oct 2022, jordi wrote: > >>> Hi guixers, > >>> > >>> i'm wondering...for my scripts to work in Guix, instead of > >>> '#! /bin/bash' , > >>> > >> > >> Typically the `sh' program should be a symlinked to `bash' in your > >> system profile. I think it is the case for many distro. If you want it > >> to be bulletproof though for other distros maybe something like that: > >> > >> #!/bin/sh > >> if [ "$(basename $SHELL)" != "bash" ]; then > >> exec bash "$0" "$@" > >> fi > >> > >> echo "hey!" > > > > I prefer the "#!/usr/bin/env bash" shebang; /usr/bin/env is available on > > FHS distribution, and on Guix System, for convenience. You can use if > > for any interpreted script, such as Guile, Python, Perl, etc. > > Only if coreutils is in the profile that would work yes. > > -- > Olivier Dion > oldiob.dev >